LibreOffice Module comphelper (master) 1
|
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 SolarMutex * | get () |
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 | |
SolarMutex & | operator= (const SolarMutex &)=delete |
Private Attributes | |
std::atomic< std::thread::id > | m_nThreadId |
BeforeReleaseHandler | m_aBeforeReleaseHandler |
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.
typedef void(* comphelper::SolarMutex::BeforeReleaseHandler) () |
Definition at line 48 of file solarmutex.hxx.
comphelper::SolarMutex::SolarMutex | ( | ) |
Definition at line 39 of file solarmutex.cxx.
References m_nCount.
|
virtual |
Definition at line 47 of file solarmutex.cxx.
|
privatedelete |
|
inline |
Definition at line 83 of file solarmutex.hxx.
References doAcquire().
|
protectedvirtual |
Definition at line 52 of file solarmutex.cxx.
References m_aMutex, m_nCount, m_nThreadId, and n.
Referenced by acquire().
|
protectedvirtual |
Definition at line 60 of file solarmutex.cxx.
References IsCurrentThread(), m_aBeforeReleaseHandler, m_aMutex, m_nCount, m_nThreadId, n, and nCount.
Referenced by release().
|
static |
Help components to get the SolarMutex easily.
Definition at line 34 of file solarmutex.cxx.
Referenced by comphelper::OCommonAccessibleComponent::addAccessibleEventListener(), comphelper::OCommonAccessibleComponent::disposing(), comphelper::ConfigurationListener::propertyChange(), comphelper::OCommonAccessibleComponent::removeAccessibleEventListener(), and comphelper::unique_disposing_solar_mutex_reset_ptr< T >::~unique_disposing_solar_mutex_reset_ptr().
|
virtual |
|
privatedelete |
|
inline |
Definition at line 89 of file solarmutex.hxx.
References doRelease().
|
inline |
Definition at line 53 of file solarmutex.hxx.
|
virtual |
Definition at line 88 of file solarmutex.cxx.
References m_aMutex, m_nCount, and m_nThreadId.
|
private |
Definition at line 80 of file solarmutex.hxx.
Referenced by doRelease().
|
protected |
Definition at line 71 of file solarmutex.hxx.
Referenced by doAcquire(), doRelease(), and tryToAcquire().
|
protected |
Definition at line 72 of file solarmutex.hxx.
Referenced by doAcquire(), doRelease(), and tryToAcquire().
|
private |
Definition at line 75 of file solarmutex.hxx.
Referenced by doAcquire(), doRelease(), IsCurrentThread(), and tryToAcquire().