CyberLink for C

ccond.h File Reference

#include <cybergarage/typedef.h>
#include <cybergarage/util/cmutex.h>
#include <pthread.h>

Data Structures

struct  _CgCond
 The generic wrapper struct for CyberLinkC's conds. More...

Typedefs

typedef struct _CgCond CgCond
 The generic wrapper struct for CyberLinkC's conds.

Functions

CgCond * cg_cond_new ()
BOOL cg_cond_delete (CgCond *cond)
BOOL cg_cond_wait (CgCond *cond, CgMutex *mutex, unsigned long timeout)
BOOL cg_cond_signal (CgCond *cond)

Typedef Documentation

typedef struct _CgCond CgCond

The generic wrapper struct for CyberLinkC's conds.

This wrapper has been created to enable 100% code compatibility for different platforms (Linux, Win32 etc..)


Function Documentation

BOOL cg_cond_delete ( CgCond *  cond)

Destroy a condition variable

Parameters:
condThe cond to destroy
CgCond* cg_cond_new ( )

Create a new condition variable

BOOL cg_cond_signal ( CgCond *  cond)

Signal a condition variable

Parameters:
condCond to be signalled
BOOL cg_cond_wait ( CgCond *  cond,
CgMutex *  mutex,
unsigned long  timeout 
)

Wait for condition variable to be signalled.

Parameters:
condCond to be waited
mutexMutex used for synchronization
timeoutMaximum time in seconds to wait, 0 to wait forever