LLVM API Documentation
Platform agnostic Mutex class. More...
#include <Mutex.h>
Public Member Functions | |
bool | acquire () |
Unconditionally acquire the lock. | |
bool | release () |
Unconditionally release the lock. | |
bool | tryacquire () |
Try to acquire the lock. | |
Constructors | |
MutexImpl (bool recursive=true) | |
Default Constructor. | |
~MutexImpl () | |
Destructor. |
llvm::MutexImpl::MutexImpl | ( | bool | recursive = true | ) | [explicit] |
Default Constructor.
Initializes the lock but doesn't acquire it. if recursive
is set to false, the lock will not be recursive which makes it cheaper but also more likely to deadlock (same thread can't acquire more than once).
Definition at line 44 of file Mutex.cpp.
References llvm::LibFunc::malloc.
Destructor.
Releases and removes the lock
Definition at line 75 of file Mutex.cpp.
References llvm::LibFunc::free.
Unconditionally acquire the lock.
Attempts to unconditionally acquire the lock. If the lock is held by another thread, this method will wait until it can acquire the lock.
Definition at line 84 of file Mutex.cpp.
Referenced by llvm::sys::SmartMutex< false >::lock().
Unconditionally release the lock.
Attempts to release the lock. If the lock is held by the current thread, the lock is released allowing other threads to acquire the lock.
Definition at line 94 of file Mutex.cpp.
Referenced by llvm::sys::SmartMutex< false >::unlock().
Try to acquire the lock.
Attempts to acquire the lock without blocking. If the lock is not available, this function returns false quickly (without blocking). If the lock is available, it is acquired.
Definition at line 104 of file Mutex.cpp.
Referenced by llvm::sys::SmartMutex< false >::try_lock().