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

Classes

struct  _mutex_st
 

Macros

#define LWP_OBJTYPE_MUTEX   3
 
#define LWP_CHECK_MUTEX(hndl)
 

Typedefs

typedef struct _mutex_st mutex_st
 

Functions

static s32 __lwp_mutex_locksupp (mutex_t lock, u32 timeout, u8 block)
 
void __lwp_mutex_init ()
 
static __inline__ mutex_st__lwp_mutex_open (mutex_t lock)
 
static __inline__ void __lwp_mutex_free (mutex_st *lock)
 
static mutex_st__lwp_mutex_allocate ()
 
s32 LWP_MutexInit (mutex_t *mutex, bool use_recursive)
 Initializes a mutex lock. More...
 
s32 LWP_MutexDestroy (mutex_t mutex)
 Close mutex lock, release all threads and handles locked on this mutex. More...
 
s32 LWP_MutexLock (mutex_t mutex)
 Enter the mutex lock. More...
 
s32 LWP_MutexTryLock (mutex_t mutex)
 Try to enter the mutex lock. More...
 
s32 LWP_MutexUnlock (mutex_t mutex)
 Release the mutex lock and let other threads process further on this mutex. More...
 

Variables

lwp_objinfo _lwp_mutex_objects
 

Macro Definition Documentation

◆ LWP_CHECK_MUTEX

#define LWP_CHECK_MUTEX (   hndl)
Value:
{ \
if(((hndl)==LWP_MUTEX_NULL) || (LWP_OBJTYPE(hndl)!=LWP_OBJTYPE_MUTEX)) \
return NULL; \
}
#define LWP_OBJTYPE(id)
Definition: lwp_objmgr.h:9
#define NULL
Pointer to 0.
Definition: gctypes.h:65
#define LWP_MUTEX_NULL
Definition: mutex.h:41
#define LWP_OBJTYPE_MUTEX
Definition: mutex.c:39

◆ LWP_OBJTYPE_MUTEX

#define LWP_OBJTYPE_MUTEX   3

Typedef Documentation

◆ mutex_st

typedef struct _mutex_st mutex_st

Function Documentation

◆ __lwp_mutex_allocate()

static mutex_st* __lwp_mutex_allocate ( )
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_mutex_free()

static __inline__ void __lwp_mutex_free ( mutex_st lock)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_mutex_init()

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

◆ __lwp_mutex_locksupp()

static s32 __lwp_mutex_locksupp ( mutex_t  lock,
u32  timeout,
u8  block 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ __lwp_mutex_open()

static __inline__ mutex_st* __lwp_mutex_open ( mutex_t  lock)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_MutexDestroy()

s32 LWP_MutexDestroy ( mutex_t  mutex)

Close mutex lock, release all threads and handles locked on this mutex.

Parameters
[in]mutexhandle to the mutex_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_MutexInit()

s32 LWP_MutexInit ( mutex_t mutex,
bool  use_recursive 
)

Initializes a mutex lock.

Parameters
[out]mutexpointer to a mutex_t handle.
[in]use_recursivewhether to allow the thread, whithin the same context, to enter multiple times the lock or not.
Returns
0 on success, <0 on error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ LWP_MutexLock()

s32 LWP_MutexLock ( mutex_t  mutex)

Enter the mutex lock.

Parameters
[in]mutexhandle to the mutext_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_MutexTryLock()

s32 LWP_MutexTryLock ( mutex_t  mutex)

Try to enter the mutex lock.

Parameters
[in]mutexhandle to the mutex_t structure.
Returns
0: on first aquire, 1: would lock
Here is the call graph for this function:

◆ LWP_MutexUnlock()

s32 LWP_MutexUnlock ( mutex_t  mutex)

Release the mutex lock and let other threads process further on this mutex.

Parameters
[in]mutexhandle to the mutex_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:

Variable Documentation

◆ _lwp_mutex_objects

lwp_objinfo _lwp_mutex_objects