RetroArch
Classes | Macros | Typedefs | Functions | Variables
cond.c File Reference
#include <stdlib.h>
#include <errno.h>
#include "asm.h"
#include "mutex.h"
#include "lwp_threadq.h"
#include "lwp_objmgr.h"
#include "lwp_config.h"
#include "cond.h"
Include dependency graph for cond.c:

Classes

struct  _cond_st
 

Macros

#define LWP_OBJTYPE_COND   5
 
#define LWP_CHECK_COND(hndl)
 

Typedefs

typedef struct _cond_st cond_st
 

Functions

int clock_gettime (struct timespec *tp)
 
void timespec_subtract (const struct timespec *tp_start, const struct timespec *tp_end, struct timespec *result)
 
void __lwp_cond_init ()
 
static __inline__ cond_st__lwp_cond_open (cond_t cond)
 
static __inline__ void __lwp_cond_free (cond_st *cond)
 
static cond_st__lwp_cond_allocate ()
 
static s32 __lwp_cond_waitsupp (cond_t cond, mutex_t mutex, u64 timeout, u8 timedout)
 
static s32 __lwp_cond_signalsupp (cond_t cond, u8 isbroadcast)
 
s32 LWP_CondInit (cond_t *cond)
 Initialize condition variable. More...
 
s32 LWP_CondWait (cond_t cond, mutex_t mutex)
 Wait on condition variable. More...
 
s32 LWP_CondSignal (cond_t cond)
 Signal a specific thread waiting on this condition variable to wake up. More...
 
s32 LWP_CondBroadcast (cond_t cond)
 Broadcast all threads waiting on this condition variable to wake up. More...
 
s32 LWP_CondTimedWait (cond_t cond, mutex_t mutex, const struct timespec *abstime)
 Timed wait on a conditionvariable. More...
 
s32 LWP_CondDestroy (cond_t cond)
 Destroy condition variable, release all threads and handles blocked on that condition variable. More...
 

Variables

lwp_objinfo _lwp_cond_objects
 

Macro Definition Documentation

◆ LWP_CHECK_COND

#define LWP_CHECK_COND (   hndl)
Value:
{ \
if(((hndl)==LWP_COND_NULL) || (LWP_OBJTYPE(hndl)!=LWP_OBJTYPE_COND)) \
return NULL; \
}
#define LWP_OBJTYPE(id)
Definition: lwp_objmgr.h:9
#define LWP_OBJTYPE_COND
Definition: cond.c:40
#define NULL
Pointer to 0.
Definition: gctypes.h:65
#define LWP_COND_NULL
Definition: cond.h:42

◆ LWP_OBJTYPE_COND

#define LWP_OBJTYPE_COND   5

Typedef Documentation

◆ cond_st

typedef struct _cond_st cond_st

Function Documentation

◆ __lwp_cond_allocate()

static cond_st* __lwp_cond_allocate ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_cond_free()

static __inline__ void __lwp_cond_free ( cond_st cond)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_cond_init()

void __lwp_cond_init ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_cond_open()

static __inline__ cond_st* __lwp_cond_open ( cond_t  cond)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_cond_signalsupp()

static s32 __lwp_cond_signalsupp ( cond_t  cond,
u8  isbroadcast 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_cond_waitsupp()

static s32 __lwp_cond_waitsupp ( cond_t  cond,
mutex_t  mutex,
u64  timeout,
u8  timedout 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ clock_gettime()

int clock_gettime ( struct timespec *  tp)
Here is the caller graph for this function:

◆ LWP_CondBroadcast()

s32 LWP_CondBroadcast ( cond_t  cond)

Broadcast all threads waiting on this condition variable to wake up.

Parameters
[in]condhandle to the cond_t structure
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_CondDestroy()

s32 LWP_CondDestroy ( cond_t  cond)

Destroy condition variable, release all threads and handles blocked on that condition variable.

Parameters
[in]condhandle to the cond_t structure
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_CondInit()

s32 LWP_CondInit ( cond_t cond)

Initialize condition variable.

Parameters
[out]condpointer to the cond_t handle
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_CondSignal()

s32 LWP_CondSignal ( cond_t  cond)

Signal a specific thread waiting on this condition variable to wake up.

Parameters
[in]condhandle to the cond_t structure
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_CondTimedWait()

s32 LWP_CondTimedWait ( cond_t  cond,
mutex_t  mutex,
const struct timespec *  abstime 
)

Timed wait on a conditionvariable.

Parameters
[in]condhandle to the cond_t structure
[in]mutexhandle to the mutex_t structure
[in]abstimepointer to a timespec structure holding the abs time for the timeout.
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_CondWait()

s32 LWP_CondWait ( cond_t  cond,
mutex_t  mutex 
)

Wait on condition variable.

Parameters
[in]condhandle to the cond_t structure
[in]mutexhandle to the mutex_t structure
Returns
0 on success, <0 on error
Here is the call graph for this function:

◆ timespec_subtract()

void timespec_subtract ( const struct timespec *  tp_start,
const struct timespec *  tp_end,
struct timespec *  result 
)

Variable Documentation

◆ _lwp_cond_objects

lwp_objinfo _lwp_cond_objects