![]() |
B2BITS FIX Antenna C++ 2.34.0
|
Mutex - provides synchronization, the ability to control how threads share resources. More...
#include <B2BITS_Mutex.h>
Public Member Functions | |
| void | lock () |
| Locks the mutex. | |
| Mutex () | |
| Constructor. | |
| Mutex (char const *name) | |
| Constructor. | |
| Mutex (std::string const &name) | |
| Constructor. | |
| char const * | name () const throw () |
| bool | try_lock () |
| Tries to acquire lock without blocking. | |
| bool | tryLock () |
| Tries to acquire lock without blocking. | |
| void | unlock () |
| Unlocks the mutex. | |
| ~Mutex () | |
| Destructor. | |
Friends | |
| class | Condition |
| class | Utils::CTGuard< Mutex > |
Mutex - provides synchronization, the ability to control how threads share resources.
You use mutexes to prevent multiple threads from modifying shared data at the same time, and to ensure that a thread can read consistent values for a set of resources (for example, memory) that may be modified by other threads.
|
explicit |
Constructor.
|
explicit |
Constructor.
| System::Mutex::Mutex | ( | ) |
Constructor.
| System::Mutex::~Mutex | ( | ) |
Destructor.
| void System::Mutex::lock | ( | ) |
Locks the mutex.
If the mutex is currently locked, the calling thread is blocked until mutex is unlocked. On return, the thread owns the mutex until it calls Mutex::unlock().
Referenced by System::ThreadSafe::MutexGuard< T >::MutexGuard().
|
inline | ||||||||||||
|
inline |
Tries to acquire lock without blocking.
This function is identical to tryLock and it's sole purpose is to make Mutex compatible with Boost's Lockable concept.
| bool System::Mutex::tryLock | ( | ) |
Tries to acquire lock without blocking.
| void System::Mutex::unlock | ( | ) |
Unlocks the mutex.
The mutex becomes unowned. If any threads are waiting for the mutex, one is awakened.
Referenced by System::ThreadSafe::MutexGuard< T >::~MutexGuard().
|
friend |
|
friend |