LibreOffice: osl/mutex.h File Reference

LibreOffice LibreOffice 24.2 SDK C/C++ API Reference

Loading...
Searching...
No Matches
Typedefs | Functions
mutex.h File Reference
`#include "sal/config.h"`
`#include "sal/saldllapi.h"`
`#include "sal/types.h"`

Go to the source code of this file.

## Typedefs
typedef struct _oslMutexImpl * | oslMutex

## Functions
SAL_DLLPUBLIC oslMutex | osl_createMutex (void)
| Create a mutex.
SAL_DLLPUBLIC void | osl_destroyMutex (oslMutex Mutex)
| Release the OS-structures and free mutex data-structure.
SAL_DLLPUBLIC sal_Bool | osl_acquireMutex (oslMutex Mutex)
| Acquire the mutex, block if already acquired by another thread.
SAL_DLLPUBLIC sal_Bool | osl_tryToAcquireMutex (oslMutex Mutex)
| Try to acquire the mutex without blocking.
SAL_DLLPUBLIC sal_Bool | osl_releaseMutex (oslMutex Mutex)
| Release the mutex.
SAL_DLLPUBLIC oslMutex * | osl_getGlobalMutex (void)
| Returns a unique and global mutex.

## Typedef Documentation

## ◆ oslMutex

typedef struct _oslMutexImpl* oslMutex

## Function Documentation

## ◆ osl_acquireMutex()

SAL_DLLPUBLIC sal_Bool osl_acquireMutex | ( | oslMutex | Mutex | ) |

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

Parameters

  Mutex | handle to a created mutex.

Return values

  False | if system-call fails.

## ◆ osl_createMutex()

SAL_DLLPUBLIC oslMutex osl_createMutex | ( | void |  | ) |

Create a mutex.

Returns
  0 if the mutex could not be created, otherwise a handle to the mutex.

## ◆ osl_destroyMutex()

SAL_DLLPUBLIC void osl_destroyMutex | ( | oslMutex | Mutex | ) |

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

Parameters

  Mutex | the mutex-handle

## ◆ osl_getGlobalMutex()

SAL_DLLPUBLIC oslMutex * osl_getGlobalMutex | ( | void |  | ) |

Returns a unique and global mutex.

Returns
  the global mutex.

## ◆ osl_releaseMutex()

SAL_DLLPUBLIC sal_Bool osl_releaseMutex | ( | oslMutex | Mutex | ) |

Release the mutex.

Parameters

  Mutex | handle to a created mutex.

Return values

  False | if system-call fails.

## ◆ osl_tryToAcquireMutex()

SAL_DLLPUBLIC sal_Bool osl_tryToAcquireMutex | ( | oslMutex | Mutex | ) |

Try to acquire the mutex without blocking.

Parameters

  Mutex | handle to a created mutex.

Return values

  False | if it could not be acquired.