LibreOffice Module comphelper (master)  1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
comphelper::SolarMutex Class Reference

SolarMutex, needed for VCL's Application::GetSolarMutex(). More...

#include <solarmutex.hxx>

Public Types

typedef void(* BeforeReleaseHandler) ()
 

Public Member Functions

 SolarMutex ()
 
virtual ~SolarMutex ()
 
void SetBeforeReleaseHandler (const BeforeReleaseHandler &rLink)
 
void acquire (sal_uInt32 nLockCount=1)
 
sal_uInt32 release (bool bUnlockAll=false)
 
virtual bool tryToAcquire ()
 
virtual bool IsCurrentThread () const
 

Static Public Member Functions

static SolarMutexget ()
 Help components to get the SolarMutex easily. More...
 

Protected Member Functions

virtual sal_uInt32 doRelease (bool bUnlockAll)
 
virtual void doAcquire (sal_uInt32 nLockCount)
 

Protected Attributes

osl::Mutex m_aMutex
 
sal_uInt32 m_nCount
 

Private Member Functions

 SolarMutex (const SolarMutex &)=delete
 
SolarMutexoperator= (const SolarMutex &)=delete
 

Private Attributes

std::atomic< oslThreadIdentifier > m_nThreadId
 
BeforeReleaseHandler m_aBeforeReleaseHandler
 

Detailed Description

SolarMutex, needed for VCL's Application::GetSolarMutex().

The SolarMutex is the one big recursive code lock used to protect the vast majority of the LibreOffice code-base, in particular anything that is graphical and the cores of the applications.

Treat this as a singleton, as its constructor sets a global pointing at itself.

Definition at line 46 of file solarmutex.hxx.

Member Typedef Documentation

typedef void(* comphelper::SolarMutex::BeforeReleaseHandler) ()

Definition at line 48 of file solarmutex.hxx.

Constructor & Destructor Documentation

comphelper::SolarMutex::SolarMutex ( )

Definition at line 39 of file solarmutex.cxx.

comphelper::SolarMutex::~SolarMutex ( )
virtual

Definition at line 48 of file solarmutex.cxx.

comphelper::SolarMutex::SolarMutex ( const SolarMutex )
privatedelete

Member Function Documentation

void comphelper::SolarMutex::acquire ( sal_uInt32  nLockCount = 1)
inline

Definition at line 83 of file solarmutex.hxx.

References doAcquire().

void comphelper::SolarMutex::doAcquire ( sal_uInt32  nLockCount)
protectedvirtual

Definition at line 53 of file solarmutex.cxx.

References m_aMutex, m_nCount, and m_nThreadId.

Referenced by acquire().

sal_uInt32 comphelper::SolarMutex::doRelease ( bool  bUnlockAll)
protectedvirtual

Definition at line 61 of file solarmutex.cxx.

References IsCurrentThread(), m_aBeforeReleaseHandler, m_aMutex, m_nCount, and m_nThreadId.

Referenced by release().

SolarMutex * comphelper::SolarMutex::get ( )
static
bool comphelper::SolarMutex::IsCurrentThread ( ) const
virtual

Definition at line 84 of file solarmutex.cxx.

References m_nThreadId.

Referenced by doRelease().

SolarMutex& comphelper::SolarMutex::operator= ( const SolarMutex )
privatedelete
sal_uInt32 comphelper::SolarMutex::release ( bool  bUnlockAll = false)
inline

Definition at line 89 of file solarmutex.hxx.

References doRelease().

void comphelper::SolarMutex::SetBeforeReleaseHandler ( const BeforeReleaseHandler rLink)
inline

Definition at line 53 of file solarmutex.hxx.

bool comphelper::SolarMutex::tryToAcquire ( )
virtual

Definition at line 89 of file solarmutex.cxx.

References m_aMutex, m_nCount, and m_nThreadId.

Member Data Documentation

BeforeReleaseHandler comphelper::SolarMutex::m_aBeforeReleaseHandler
private

Definition at line 80 of file solarmutex.hxx.

Referenced by doRelease().

osl::Mutex comphelper::SolarMutex::m_aMutex
protected

Definition at line 71 of file solarmutex.hxx.

Referenced by doAcquire(), doRelease(), and tryToAcquire().

sal_uInt32 comphelper::SolarMutex::m_nCount
protected

Definition at line 72 of file solarmutex.hxx.

Referenced by doAcquire(), doRelease(), and tryToAcquire().

std::atomic<oslThreadIdentifier> comphelper::SolarMutex::m_nThreadId
private

Definition at line 75 of file solarmutex.hxx.

Referenced by doAcquire(), doRelease(), IsCurrentThread(), and tryToAcquire().


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