KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KIGIT::ACTION_LOCK Class Reference

KIGIT_COMMON's action lock, the session's mutex and then the working tree's REPO_ACTION_LOCK, so another process waits for the action too. More...

#include <kigit_action_lock.h>

Public Member Functions

 ACTION_LOCK ()=default
 
 ACTION_LOCK (std::unique_lock< std::mutex > &&aMutex)
 The mutex alone, which no other process sees.
 
 ACTION_LOCK (std::unique_lock< std::mutex > &&aMutex, std::unique_ptr< REPO_ACTION_LOCK > aRepo)
 
 ACTION_LOCK (ACTION_LOCK &&) noexcept=default
 
ACTION_LOCK & operator= (ACTION_LOCK &&aOther) noexcept
 
 ~ACTION_LOCK ()
 
bool owns_lock () const
 
 operator bool () const
 
void unlock ()
 

Private Attributes

std::unique_lock< std::mutex > m_mutex
 
std::unique_ptr< REPO_ACTION_LOCK > m_repo
 Null when nothing outside this process can share the tree.
 

Detailed Description

KIGIT_COMMON's action lock, the session's mutex and then the working tree's REPO_ACTION_LOCK, so another process waits for the action too.

It owns the lock only while it holds both.

Definition at line 35 of file kigit_action_lock.h.

Constructor & Destructor Documentation

◆ ACTION_LOCK() [1/4]

KIGIT::ACTION_LOCK::ACTION_LOCK ( )
default

Referenced by ACTION_LOCK(), and operator=().

◆ ACTION_LOCK() [2/4]

KIGIT::ACTION_LOCK::ACTION_LOCK ( std::unique_lock< std::mutex > && aMutex)
inlineexplicit

The mutex alone, which no other process sees.

Definition at line 41 of file kigit_action_lock.h.

References m_mutex, and move.

◆ ACTION_LOCK() [3/4]

KIGIT::ACTION_LOCK::ACTION_LOCK ( std::unique_lock< std::mutex > && aMutex,
std::unique_ptr< REPO_ACTION_LOCK > aRepo )
inline

Definition at line 46 of file kigit_action_lock.h.

References m_mutex, m_repo, and move.

◆ ACTION_LOCK() [4/4]

KIGIT::ACTION_LOCK::ACTION_LOCK ( ACTION_LOCK && )
defaultnoexcept

References ACTION_LOCK().

◆ ~ACTION_LOCK()

KIGIT::ACTION_LOCK::~ACTION_LOCK ( )
inline

Definition at line 66 of file kigit_action_lock.h.

References unlock().

Member Function Documentation

◆ operator bool()

KIGIT::ACTION_LOCK::operator bool ( ) const
inlineexplicit

Definition at line 70 of file kigit_action_lock.h.

References owns_lock().

◆ operator=()

ACTION_LOCK & KIGIT::ACTION_LOCK::operator= ( ACTION_LOCK && aOther)
inlinenoexcept

Definition at line 54 of file kigit_action_lock.h.

References ACTION_LOCK(), m_mutex, m_repo, and unlock().

◆ owns_lock()

◆ unlock()

Member Data Documentation

◆ m_mutex

std::unique_lock<std::mutex> KIGIT::ACTION_LOCK::m_mutex
private

Definition at line 81 of file kigit_action_lock.h.

Referenced by ACTION_LOCK(), ACTION_LOCK(), operator=(), owns_lock(), and unlock().

◆ m_repo

std::unique_ptr<REPO_ACTION_LOCK> KIGIT::ACTION_LOCK::m_repo
private

Null when nothing outside this process can share the tree.

Definition at line 82 of file kigit_action_lock.h.

Referenced by ACTION_LOCK(), operator=(), owns_lock(), and unlock().


The documentation for this class was generated from the following file: