|
LLVM
4.0.0
|
Platform agnostic Mutex class. More...
#include <Mutex.h>
Public Member Functions | |
Constructors | |
| MutexImpl (bool recursive=true) | |
| Initializes the lock but doesn't acquire it. More... | |
| ~MutexImpl () | |
| Releases and removes the lock. More... | |
Methods | |
| bool | acquire () |
| Attempts to unconditionally acquire the lock. More... | |
| bool | release () |
| Attempts to release the lock. More... | |
| bool | tryacquire () |
| Attempts to acquire the lock without blocking. More... | |
| llvm::MutexImpl::~MutexImpl | ( | ) |
| bool llvm::MutexImpl::acquire | ( | ) |
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.
References assert().
Referenced by llvm::sys::SmartMutex< false >::lock().
| bool llvm::MutexImpl::release | ( | ) |
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.
References assert().
Referenced by llvm::sys::SmartMutex< false >::unlock().
| bool llvm::MutexImpl::tryacquire | ( | ) |
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.
References assert().
Referenced by llvm::sys::SmartMutex< false >::try_lock().
1.8.6