class Mutex
Defined at line 18 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
C++ wrapper around |sync_mutex_t|. This can be more efficient than the
standard C |mtx_t| or C++ |std::mutex|.
It satisfies the BasicLockable C++ requirement.
Public Methods
void Mutex ()
Defined at line 20 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
void ~Mutex ()
Defined at line 21 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
void Mutex (const Mutex & )
Defined at line 22 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
Mutex & operator= (const Mutex & )
Defined at line 23 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
void Mutex (Mutex && )
Defined at line 24 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
Mutex & operator= (Mutex && )
Defined at line 25 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
void lock ()
Locks the mutex.
The current thread will block until the mutex is acquired. The mutex is
non-recursive, which means attempting to lock a mutex that is already held by
this thread will deadlock.
Defined at line 32 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
bool try_lock ()
Attempts to lock the mutex without blocking.
Returns true if the lock is obtained, and false if not.
Defined at line 37 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
void unlock ()
Unlocks the mutex.
Do not unlock the mutex again if it is already unlocked. Do not rely
on any behavior from duplicated unlocking.
Defined at line 43 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h
sync_mutex_t * get ()
Returns the wrapped |sync_mutex_t|.
Defined at line 46 of file ../../zircon/system/ulib/sync/include/lib/sync/cpp/mutex.h