RAII wrapper for mutex that acquires the mutex on construction and releases it on destruction.
More...
#include <coopsync_tbb/mutex.hpp>
RAII wrapper for mutex that acquires the mutex on construction and releases it on destruction.
◆ scoped_lock()
| coopsync_tbb::mutex::scoped_lock::scoped_lock |
( |
mutex & | m | ) |
|
|
explicit |
Constructs a scoped_lock and acquires the given mutex.
- Parameters
-
◆ acquire()
| void coopsync_tbb::mutex::scoped_lock::acquire |
( |
mutex & | m | ) |
|
Acquires the mutex.
- Parameters
-
- Exceptions
-
| std::system_error | if another mutex is already acquired. |
◆ try_acquire()
| bool coopsync_tbb::mutex::scoped_lock::try_acquire |
( |
mutex & | m | ) |
|
|
nodiscard |
Attempts to acquire the mutex without blocking.
- Parameters
-
- Returns
- true if the mutex was successfully acquired, false otherwise.
- Exceptions
-
| std::system_error | if another mutex is already acquired. |
The documentation for this class was generated from the following file: