LLVM API Documentation

Public Member Functions
llvm::sys::SmartMutex< mt_only > Class Template Reference

#include <Mutex.h>

Inheritance diagram for llvm::sys::SmartMutex< mt_only >:
Inheritance graph
[legend]
Collaboration diagram for llvm::sys::SmartMutex< mt_only >:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 SmartMutex (bool rec=true)
bool acquire ()
 Unconditionally acquire the lock.
bool release ()
 Unconditionally release the lock.
bool tryacquire ()
 Try to acquire the lock.

Detailed Description

template<bool mt_only>
class llvm::sys::SmartMutex< mt_only >

SmartMutex - A mutex with a compile time constant parameter that indicates whether this mutex should become a no-op when we're not running in multithreaded mode.

Definition at line 89 of file Mutex.h.


Constructor & Destructor Documentation

template<bool mt_only>
llvm::sys::SmartMutex< mt_only >::SmartMutex ( bool  rec = true) [inline, explicit]

Definition at line 93 of file Mutex.h.


Member Function Documentation

template<bool mt_only>
bool llvm::sys::SmartMutex< mt_only >::acquire ( ) [inline]

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.

Returns:
false if any kind of error occurs, true otherwise.

Reimplemented from llvm::sys::MutexImpl.

Definition at line 96 of file Mutex.h.

Referenced by llvm::sys::SmartMutex< false >::acquire(), llvm::ValueMapCallbackVH< KeyT, ValueT, Config >::allUsesReplacedWith(), llvm::ValueMapCallbackVH< KeyT, ValueT, Config >::deleted(), llvm::llvm_acquire_global_lock(), and llvm::MutexGuard::MutexGuard().

template<bool mt_only>
bool llvm::sys::SmartMutex< mt_only >::release ( ) [inline]

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.

Returns:
false if any kind of error occurs, true otherwise.

Reimplemented from llvm::sys::MutexImpl.

Definition at line 109 of file Mutex.h.

Referenced by llvm::ValueMapCallbackVH< KeyT, ValueT, Config >::allUsesReplacedWith(), llvm::ValueMapCallbackVH< KeyT, ValueT, Config >::deleted(), llvm::llvm_release_global_lock(), llvm::sys::SmartMutex< false >::release(), and llvm::MutexGuard::~MutexGuard().

template<bool mt_only>
bool llvm::sys::SmartMutex< mt_only >::tryacquire ( ) [inline]

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.

Returns:
false if any kind of error occurs or the lock is not available, true otherwise.

Reimplemented from llvm::sys::MutexImpl.

Definition at line 123 of file Mutex.h.

Referenced by llvm::sys::SmartMutex< false >::tryacquire().


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