psl1ght
A free SDK for Sony's PS3 console
mutex.h
Go to the documentation of this file.
1 
5 #ifndef __LV2_MUTEX_H__
6 #define __LV2_MUTEX_H__
7 
8 #include <ppu-types.h>
9 
10 #define SYS_LWMUTEX_ATTR_PROTOCOL 0x0002
11 #define SYS_LWMUTEX_ATTR_RECURSIVE 0x0010
12 
14 #define SYS_LWMUTEX_PROTOCOL_FIFO 1
15 
16 #define SYS_LWMUTEX_PROTOCOL_PRIO 2
17 
18 #define SYS_LWMUTEX_PROTOCOL_PRIO_INHERIT 3
19 
21 #define SYS_LWMUTEX_ATTR_RECURSIVE 0x0010
22 
23 #define SYS_LWMUTEX_ATTR_NOT_RECURSIVE 0x0020
24 
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
31 typedef struct sys_lwmutex
32 {
33  u64 lock_var;
34  u32 attribute;
37  u32 _pad;
39 
41 typedef struct sys_lwmutex_attr
42 {
59  char name[8];
61 
67 s32 sysLwMutexCreate(sys_lwmutex_t *mutex,const sys_lwmutex_attr_t *attr);
68 
74 
81 s32 sysLwMutexLock(sys_lwmutex_t *mutex,u64 timeout);
82 
90 
96 
97 #ifdef __cplusplus
98  }
99 #endif
100 
101 #endif
char name[8]
Lightweight mutex name.
Definition: mutex.h:59
struct sys_lwmutex_attr sys_lwmutex_attr_t
Lightweight mutex attributes data structure.
u32 _pad
Unused padding element.
Definition: mutex.h:37
u64 lock_var
Locking variable.
Definition: mutex.h:33
u32 attr_recursive
Recursive setting.
Definition: mutex.h:57
s32 sysLwMutexDestroy(sys_lwmutex_t *mutex)
Destroy a lightweight mutex.
Lightweight mutex attributes data structure.
Definition: mutex.h:41
struct sys_lwmutex sys_lwmutex_t
Lightweight mutex data structure.
Lightweight mutex data structure.
Definition: mutex.h:31
s32 sysLwMutexTryLock(sys_lwmutex_t *mutex)
Try to lock a lightweight mutex (non-blocking).
s32 sysLwMutexUnlock(sys_lwmutex_t *mutex)
Unlock a previously locked lightweight mutex.
u32 sleep_queue
Sleep queue.
Definition: mutex.h:36
u32 recursive_count
Recursive count.
Definition: mutex.h:35
s32 sysLwMutexLock(sys_lwmutex_t *mutex, u64 timeout)
Lock a lightweight mutex.
u32 attr_protocol
Scheduling policy.
Definition: mutex.h:50
s32 sysLwMutexCreate(sys_lwmutex_t *mutex, const sys_lwmutex_attr_t *attr)
Create a lightweight mutex.
u32 attribute
Attribute.
Definition: mutex.h:34