20#ifndef KIGIT_ACTION_LOCK_H
21#define KIGIT_ACTION_LOCK_H
41 explicit ACTION_LOCK( std::unique_lock<std::mutex>&& aMutex ) :
46 ACTION_LOCK( std::unique_lock<std::mutex>&& aMutex, std::unique_ptr<REPO_ACTION_LOCK> aRepo ) :
59 m_mutex = std::move( aOther.m_mutex );
60 m_repo = std::move( aOther.m_repo );
70 explicit operator bool()
const {
return owns_lock(); }
82 std::unique_ptr<REPO_ACTION_LOCK>
m_repo;
ACTION_LOCK(std::unique_lock< std::mutex > &&aMutex)
The mutex alone, which no other process sees.
std::unique_lock< std::mutex > m_mutex
ACTION_LOCK(std::unique_lock< std::mutex > &&aMutex, std::unique_ptr< REPO_ACTION_LOCK > aRepo)
std::unique_ptr< REPO_ACTION_LOCK > m_repo
Null when nothing outside this process can share the tree.
ACTION_LOCK(ACTION_LOCK &&) noexcept=default
Retrying short git writes that lost a race with another process.