Abstraction of a mutex.A mutex object is used to protect a shared resource from simultaneous access by multiple threads or processes. Each thread must wait for ownership of the mutex before it can execute the code that accesses the shared resource. For example, if several threads share access to a database, the threads can use a mutex object to permit only one thread at a time to write to the database. More...
Abstraction of a mutex.A mutex object is used to protect a shared resource from simultaneous access by multiple threads or processes. Each thread must wait for ownership of the mutex before it can execute the code that accesses the shared resource. For example, if several threads share access to a database, the threads can use a mutex object to permit only one thread at a time to write to the database.
Public Member Methods | |
Mutex () | |
Default constructor. More... | |
Mutex (PCChar8 name) | |
Default constructor. More... | |
~Mutex () | |
Destructor. More... | |
void | Lock () |
Locks the mutex. More... | |
bool | Lock (TimeSpan timeOut) |
Locks the mutex. More... | |
void | Unlock () |
Unlocks the mutex. More... | |
Mutex | ( | ) |
Default constructor.
Default constructor.
name | The name. |
~Mutex | ( | ) |
Destructor.
|
virtual |
Locks the mutex.
Implements ILockable.
bool Lock | ( | TimeSpan | timeOut | ) |
Locks the mutex.
timeOut | The time out. |
|
virtual |
Unlocks the mutex.
Implements ILockable.