ledger-core
Public Member Functions | List of all members
ledger::core::api::Lock Class Referenceabstract

#include <Lock.hpp>

Public Member Functions

virtual void lock ()=0
 
virtual bool tryLock ()=0
 
virtual void unlock ()=0
 

Detailed Description

Class representing a lock, for thread safety purposes

Member Function Documentation

◆ lock()

virtual void ledger::core::api::Lock::lock ( )
pure virtual

Acquire lock by thread calling this method, If Lock already acquired by another thread, execution of calling thread should be blocked until the other thread call the unlock method

◆ tryLock()

virtual bool ledger::core::api::Lock::tryLock ( )
pure virtual

Try to acquire lock If Lock already aquired by another thread, method returns false for calling thread without blocking its execution

Returns
bool, return true if Lock acquire by calling thread, false otherwise

◆ unlock()

virtual void ledger::core::api::Lock::unlock ( )
pure virtual

Release Lock ownership by calling thread


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