LibreOffice
LibreOffice 24.2 SDK C/C++ API Reference
Typedefs | Enumerations | Functions
conditn.h File Reference
#include "sal/config.h"
#include "osl/time.h"
#include "sal/saldllapi.h"

Go to the source code of this file.

Typedefs

typedef void * oslCondition
 

Enumerations

enum  oslConditionResult { osl_cond_result_ok, osl_cond_result_error, osl_cond_result_timeout, osl_cond_result_FORCE_EQUAL_SIZE = SAL_MAX_ENUM }
 

Functions

SAL_DLLPUBLIC oslCondition osl_createCondition (void)
 Creates a condition. More...
 
SAL_DLLPUBLIC void osl_destroyCondition (oslCondition Condition)
 Free the memory used by the condition. More...
 
SAL_DLLPUBLIC sal_Bool osl_setCondition (oslCondition Condition)
 Sets condition to True => wait() will not block, check() returns True. More...
 
SAL_DLLPUBLIC sal_Bool osl_resetCondition (oslCondition Condition)
 Sets condition to False => wait() will block, check() returns False. More...
 
SAL_DLLPUBLIC oslConditionResult osl_waitCondition (oslCondition Condition, const TimeValue *pTimeout)
 Blocks if condition is not set. More...
 
SAL_DLLPUBLIC sal_Bool osl_checkCondition (oslCondition Condition)
 Queries the state of the condition without blocking. More...
 

Typedef Documentation

◆ oslCondition

typedef void* oslCondition

Enumeration Type Documentation

◆ oslConditionResult

Enumerator
osl_cond_result_ok 
osl_cond_result_error 
osl_cond_result_timeout 
osl_cond_result_FORCE_EQUAL_SIZE 

Function Documentation

◆ osl_checkCondition()

SAL_DLLPUBLIC sal_Bool osl_checkCondition ( oslCondition  Condition)

Queries the state of the condition without blocking.

Parameters
Conditionhandle to a created condition.
Return values
Truecondition is set
Falsecondition is not set

◆ osl_createCondition()

SAL_DLLPUBLIC oslCondition osl_createCondition ( void  )

Creates a condition.

Deprecated:
use C++11's std::condition_variable instead for a more robust and helpful condition.

The condition is in the reset-state.

Return values
osl_cond_result_errorCondition could not be created.

◆ osl_destroyCondition()

SAL_DLLPUBLIC void osl_destroyCondition ( oslCondition  Condition)

Free the memory used by the condition.

Parameters
Conditionthe condition handle.

◆ osl_resetCondition()

SAL_DLLPUBLIC sal_Bool osl_resetCondition ( oslCondition  Condition)

Sets condition to False => wait() will block, check() returns False.

Parameters
Conditionhandle to a created condition.
Return values
Falseif system-call failed.

◆ osl_setCondition()

SAL_DLLPUBLIC sal_Bool osl_setCondition ( oslCondition  Condition)

Sets condition to True => wait() will not block, check() returns True.

Attention
all threads waiting on this condition are unblocked!
Parameters
Conditionhandle to a created condition.
Return values
Falseif system-call failed.

◆ osl_waitCondition()

SAL_DLLPUBLIC oslConditionResult osl_waitCondition ( oslCondition  Condition,
const TimeValue pTimeout 
)

Blocks if condition is not set.

Parameters
Conditionhandle to a created condition.
pTimeoutTimeout value or NULL for infinite waiting
Return values
FalseCondition has been destroyed prematurely or system call has failed.