psl1ght
A free SDK for Sony's PS3 console
Data Structures | Macros | Typedefs | Functions
cond.h File Reference

Condition variables management. More...

#include <lv2/cond.h>

Go to the source code of this file.

Data Structures

struct  sys_cond_attr
 Condition variable attributes data structure. More...
 

Macros

#define SYS_COND_ATTR_PSHARED   0x0200
 Pshared attribute for condition variables.
 

Typedefs

typedef struct sys_cond_attr sys_cond_attr_t
 Condition variable attributes data structure.
 

Functions

LV2_SYSCALL sysCondCreate (sys_cond_t *cond, sys_mutex_t mutex, const sys_cond_attr_t *attr)
 Create a condition variable. More...
 
LV2_SYSCALL sysCondDestroy (sys_cond_t cond)
 Destroy a condition variable. More...
 
LV2_SYSCALL sysCondWait (sys_cond_t cond, u64 timeout_usec)
 Wait for a condition variable to be signaled. More...
 
LV2_SYSCALL sysCondSignal (sys_cond_t cond)
 Signal a condition variable to at most one waiting thread. More...
 
LV2_SYSCALL sysCondBroadcast (sys_cond_t cond)
 Signal a condition variable to all waiting threads. More...
 

Detailed Description

Condition variables management.

Function Documentation

◆ sysCondBroadcast()

LV2_SYSCALL sysCondBroadcast ( sys_cond_t  cond)

Signal a condition variable to all waiting threads.

Parameters
condCondition variable identifier.
Returns
zero if no error occured, nonzero otherwise.

◆ sysCondCreate()

LV2_SYSCALL sysCondCreate ( sys_cond_t *  cond,
sys_mutex_t  mutex,
const sys_cond_attr_t attr 
)

Create a condition variable.

Parameters
condPointer to storage for the created condition variable identifier.
mutexPointer to the associated mutex.
attrPointer to the attributes data structure.
Returns
zero if no error occured, nonzero otherwise.

◆ sysCondDestroy()

LV2_SYSCALL sysCondDestroy ( sys_cond_t  cond)

Destroy a condition variable.

Parameters
condCondition variable identifier.
Returns
zero if no error occured, nonzero otherwise.

◆ sysCondSignal()

LV2_SYSCALL sysCondSignal ( sys_cond_t  cond)

Signal a condition variable to at most one waiting thread.

Parameters
condCondition variable identifier.
Returns
zero if no error occured, nonzero otherwise.

◆ sysCondWait()

LV2_SYSCALL sysCondWait ( sys_cond_t  cond,
u64  timeout_usec 
)

Wait for a condition variable to be signaled.

The associated mutex must have been previously locked by the calling thread. This function atomically unlocks the mutex and waits for the condition variable to be signaled. Before returning to the calling thread, this function re-acquires the mutex.

Parameters
condCondition variable identifier.
timeout_usecTimeout value in microseconds, or 0 if no timeout is used.
Returns
zero if the condition variable was signaled, nonzero in case of error or if a timeout occured.