|
Turi Create
4.0
|
#include <core/parallel/mutex.hpp>
Public Member Functions | |
| mutex () | |
| constructs a mutex | |
| mutex (const mutex &) | |
| void | lock () const |
| Acquires a lock on the mutex. | |
| void | unlock () const |
| Releases a lock on the mutex. | |
| bool | try_lock () const |
| Non-blocking attempt to acquire a lock on the mutex. | |
Simple wrapper around pthread's mutex. Before you use, see parallel_object_intricacies.
Windows recursive mutex are annoyingly recursive. We need to prevent recursive locks. We do this by associating an addition boolean "locked" to the mutex. Hence in the event of a double lock, on Windows the behavior is slightly different. On Linux/Mac this will trigger a deadlock. On Windows, this will trigger an assertion failure.
|
inline |