LibreOffice
LibreOffice 5.3 SDK C/C++ API Reference
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | List of all members
osl::Mutex Class Reference

A mutual exclusion synchronization object. More...

#include <mutex.hxx>

Public Member Functions

 Mutex ()
 Create a mutex. More...
 
 ~Mutex ()
 Release the OS-structures and free mutex data-structure. More...
 
bool acquire ()
 Acquire the mutex, block if already acquired by another thread. More...
 
bool tryToAcquire ()
 Try to acquire the mutex without blocking. More...
 
bool release ()
 Release the mutex. More...
 

Static Public Member Functions

static MutexgetGlobalMutex ()
 Returns a global static mutex object. More...
 

Detailed Description

A mutual exclusion synchronization object.

Constructor & Destructor Documentation

osl::Mutex::Mutex ( )
inline

Create a mutex.

Returns
0 if the mutex could not be created, otherwise a handle to the mutex.
See Also
osl_createMutex()
osl::Mutex::~Mutex ( )
inline

Release the OS-structures and free mutex data-structure.

See Also
osl_destroyMutex()

Member Function Documentation

bool osl::Mutex::acquire ( )
inline

Acquire the mutex, block if already acquired by another thread.

Returns
false if system-call fails.
See Also
osl_acquireMutex()
static Mutex* osl::Mutex::getGlobalMutex ( )
inlinestatic

Returns a global static mutex object.

The global and static mutex object can be used to initialize other static objects in a thread safe manner.

Returns
the global mutex object
See Also
osl_getGlobalMutex()
bool osl::Mutex::release ( )
inline

Release the mutex.

Returns
false if system-call fails.
See Also
osl_releaseMutex()
bool osl::Mutex::tryToAcquire ( )
inline

Try to acquire the mutex without blocking.

Returns
false if it could not be acquired.
See Also
osl_tryToAcquireMutex()

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