#include <queuing_mutex.h>
Public Member Functions | |
| scoped_lock () | |
| Construct lock that has not acquired a mutex. | |
| scoped_lock (queuing_mutex &m) | |
| Acquire lock on given mutex. | |
| ~scoped_lock () | |
| Release lock (if lock is held). | |
| void __TBB_EXPORTED_METHOD | acquire (queuing_mutex &m) |
| Acquire lock on given mutex. | |
| bool __TBB_EXPORTED_METHOD | try_acquire (queuing_mutex &m) |
| Acquire lock on given mutex if free (i.e. non-blocking). | |
| void __TBB_EXPORTED_METHOD | release () |
| Release lock. | |
It helps to avoid the common problem of forgetting to release lock. It also nicely provides the "node" for queuing locks.
| tbb::queuing_mutex::scoped_lock::scoped_lock | ( | ) | [inline] |
Construct lock that has not acquired a mutex.
Equivalent to zero-initialization of *this.
| tbb::queuing_mutex::scoped_lock::scoped_lock | ( | queuing_mutex & | m | ) | [inline] |
Acquire lock on given mutex.
Upon entry, *this should not be in the "have acquired a mutex" state.