psl1ght
A free SDK for Sony's PS3 console
Loading...
Searching...
No Matches
cond.h
Go to the documentation of this file.
1
5#ifndef __SYS_COND_H__
6#define __SYS_COND_H__
7
8#include <lv2/cond.h>
9
11#define SYS_COND_ATTR_PSHARED 0x0200
12
13#ifdef __cplusplus
14 extern "C" {
15#endif
16
18typedef struct sys_cond_attr
19{
22 s32 flags;
23 u64 key;
24 char name[8];
26
27#define sysCondAttrInitialize(x) \
28 do { \
29 x.attr_pshared = SYS_COND_ATTR_PSHARED; \
30 x.key = 0; \
31 x.flags = 0; \
32 x.name[0] = '\0'; \
33 } while(0)
34
41LV2_SYSCALL sysCondCreate(sys_cond_t *cond,sys_mutex_t mutex,const sys_cond_attr_t *attr)
42{
43 lv2syscall3(105,(u64)cond,mutex,(u64)attr);
44 return_to_user_prog(s32);
45}
46
51LV2_SYSCALL sysCondDestroy(sys_cond_t cond)
52{
53 lv2syscall1(106,cond);
54 return_to_user_prog(s32);
55}
56
69LV2_SYSCALL sysCondWait(sys_cond_t cond,u64 timeout_usec)
70{
71 lv2syscall2(107,cond,timeout_usec);
72 return_to_user_prog(s32);
73}
74
79LV2_SYSCALL sysCondSignal(sys_cond_t cond)
80{
81 lv2syscall1(108,cond);
82 return_to_user_prog(s32);
83}
84
89LV2_SYSCALL sysCondBroadcast(sys_cond_t cond)
90{
91 lv2syscall1(109,cond);
92 return_to_user_prog(s32);
93}
94
95#ifdef __cplusplus
96 }
97#endif
98
99#endif
Lightweight condition variable library.
Condition variable attributes data structure.
Definition cond.h:19
u64 key
Definition cond.h:23
s32 flags
Definition cond.h:22
u32 attr_pshared
Pshared flag. Must be 0 or SYS_COND_ATTR_PSHARED.
Definition cond.h:21
char name[8]
Definition cond.h:24
LV2_SYSCALL sysCondCreate(sys_cond_t *cond, sys_mutex_t mutex, const sys_cond_attr_t *attr)
Create a condition variable.
Definition cond.h:41
struct sys_cond_attr sys_cond_attr_t
Condition variable attributes data structure.
LV2_SYSCALL sysCondDestroy(sys_cond_t cond)
Destroy a condition variable.
Definition cond.h:51
LV2_SYSCALL sysCondBroadcast(sys_cond_t cond)
Signal a condition variable to all waiting threads.
Definition cond.h:89
LV2_SYSCALL sysCondWait(sys_cond_t cond, u64 timeout_usec)
Wait for a condition variable to be signaled.
Definition cond.h:69
LV2_SYSCALL sysCondSignal(sys_cond_t cond)
Signal a condition variable to at most one waiting thread.
Definition cond.h:79