Turi Create  4.0
turi::mutex Class Reference

#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.
 

Detailed Description

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.

Definition at line 29 of file mutex.hpp.

Constructor & Destructor Documentation

◆ mutex()

turi::mutex::mutex ( const mutex )
inline

Copy constructor which does not copy. Do not use! Required for compatibility with some STL implementations (LLVM). which use the copy constructor for vector resize, rather than the standard constructor.

Definition at line 45 of file mutex.hpp.


The documentation for this class was generated from the following file: