LLVM  8.0.1
Public Member Functions | List of all members
llvm::unique_lock< MutexT > Class Template Reference

A pared-down imitation of std::unique_lock from C++11. More...

#include "llvm/Support/UniqueLock.h"

Public Member Functions

 unique_lock ()=default
 
 unique_lock (MutexT &m)
 
 unique_lock (const unique_lock &)=delete
 
unique_lockoperator= (const unique_lock &)=delete
 
void operator= (unique_lock &&o)
 
 ~unique_lock ()
 
void lock ()
 
void unlock ()
 
bool owns_lock ()
 

Detailed Description

template<typename MutexT>
class llvm::unique_lock< MutexT >

A pared-down imitation of std::unique_lock from C++11.

Contrary to the name, it's really more of a wrapper for a lock. It may or may not have an associated mutex, which is guaranteed to be locked upon creation and unlocked after destruction. unique_lock can also unlock the mutex and re-lock it freely during its lifetime. Guard a section of code with a mutex.

Definition at line 29 of file UniqueLock.h.

Constructor & Destructor Documentation

◆ unique_lock() [1/3]

template<typename MutexT>
llvm::unique_lock< MutexT >::unique_lock ( )
default

◆ unique_lock() [2/3]

template<typename MutexT>
llvm::unique_lock< MutexT >::unique_lock ( MutexT &  m)
inlineexplicit

◆ unique_lock() [3/3]

template<typename MutexT>
llvm::unique_lock< MutexT >::unique_lock ( const unique_lock< MutexT > &  )
delete

◆ ~unique_lock()

template<typename MutexT>
llvm::unique_lock< MutexT >::~unique_lock ( )
inline

Definition at line 48 of file UniqueLock.h.

References llvm::unique_lock< MutexT >::owns_lock().

Member Function Documentation

◆ lock()

template<typename MutexT>
void llvm::unique_lock< MutexT >::lock ( )
inline

Definition at line 50 of file UniqueLock.h.

References assert().

◆ operator=() [1/2]

template<typename MutexT>
unique_lock& llvm::unique_lock< MutexT >::operator= ( const unique_lock< MutexT > &  )
delete

◆ operator=() [2/2]

template<typename MutexT>
void llvm::unique_lock< MutexT >::operator= ( unique_lock< MutexT > &&  o)
inline

Definition at line 39 of file UniqueLock.h.

References llvm::unique_lock< MutexT >::owns_lock().

◆ owns_lock()

template<typename MutexT>
bool llvm::unique_lock< MutexT >::owns_lock ( )
inline

◆ unlock()

template<typename MutexT>
void llvm::unique_lock< MutexT >::unlock ( )
inline

Definition at line 57 of file UniqueLock.h.

References assert().

Referenced by llvm::Interpreter::callExternalFunction().


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