vitasdk
Documentation of the vitasdk
rwlock.h
Go to the documentation of this file.
1 
6 #ifndef _PSP2_KERNEL_THREADMGR_RWLOCK_H_
7 #define _PSP2_KERNEL_THREADMGR_RWLOCK_H_
8 
9 #include <vitasdk/build_utils.h>
10 #include <psp2/types.h>
11 
12 #ifdef __cplusplus
13 extern "C" {
14 #endif
15 
16 
18 typedef struct SceKernelRWLockOptParam {
23 
27 typedef struct SceKernelRWLockInfo {
33  char name[32];
46 
61 SceUID sceKernelCreateRWLock(const char *name, SceUInt32 attr, const SceKernelRWLockOptParam *opt_param);
62 
70 
77 SceUID sceKernelOpenRWLock(const char *name);
78 
86 
94 int sceKernelLockReadRWLock(SceUID rwlock_id, unsigned int *timeout);
95 
103 int sceKernelLockWriteRWLock(SceUID rwlock_id, unsigned int *timeout);
104 
112 int sceKernelLockReadRWLockCB(SceUID rwlock_id, unsigned int *timeout);
113 
121 int sceKernelLockWriteRWLockCB(SceUID rwlock_id, unsigned int *timeout);
122 
130 
138 
146 
154 
164 
165 
166 #ifdef __cplusplus
167 }
168 #endif
169 
170 #endif /* _PSP2_KERNEL_THREADMGR_RWLOCK_H_ */
SceSize size
Size of the SceKernelRWLockOptParam structure.
Definition: rwlock.h:20
SceSize size
Size of the SceKernelRWLockInfo structure.
Definition: rwlock.h:29
VITASDK_BUILD_ASSERT_EQ(4, SceKernelRWLockOptParam)
SceUInt32 attr
Attributes.
Definition: rwlock.h:35
SceUID rwLockId
The UID of the rwlock.
Definition: rwlock.h:31
int sceKernelLockWriteRWLock(SceUID rwlock_id, unsigned int *timeout)
Lock a rwlock with write access.
SceUInt32 numReadWaitThreads
The number of threads waiting on the rwlock for read access.
Definition: rwlock.h:41
int sceKernelGetRWLockInfo(SceUID rwlock_id, SceKernelRWLockInfo *info)
Retrieve information about a rwlock.
int sceKernelLockReadRWLockCB(SceUID rwlock_id, unsigned int *timeout)
Lock a rwlock with read access and handle callbacks.
char name[32]
NULL-terminated name of the rwlock.
Definition: rwlock.h:33
int sceKernelCloseRWLock(SceUID rwlock_id)
Close a rwlock.
int sceKernelUnlockReadRWLock(SceUID rwlock_id)
Try to unlock a rwlock with read access (non-blocking)
int sceKernelUnlockWriteRWLock(SceUID rwlock_id)
Try to unlock a rwlock with write access (non-blocking)
SceUID sceKernelOpenRWLock(const char *name)
Open a rwlock.
SceInt32 lockCount
The current lock count.
Definition: rwlock.h:37
int sceKernelLockWriteRWLockCB(SceUID rwlock_id, unsigned int *timeout)
Lock a rwlock with write access and handle callbacks.
int sceKernelDeleteRWLock(SceUID rwlock_id)
Destroy a rwlock.
SceUInt32 numWriteWaitThreads
The number of threads waiting on the rwlock for write access.
Definition: rwlock.h:43
int sceKernelTryLockWriteRWLock(SceUID rwlock_id)
Try to lock a rwlock with write access (non-blocking)
int sceKernelLockReadRWLock(SceUID rwlock_id, unsigned int *timeout)
Lock a rwlock with read access.
SceUID sceKernelCreateRWLock(const char *name, SceUInt32 attr, const SceKernelRWLockOptParam *opt_param)
Creates a new rwlock.
SceUID writeOwnerId
The UID of the current owner of the rwlock with write access, 0 when locked for reads.
Definition: rwlock.h:39
int sceKernelTryLockReadRWLock(SceUID rwlock_id)
Try to lock a rwlock with read access (non-blocking)
Current state of a rwlock.
Definition: rwlock.h:27
Additional options used when creating rwlock.
Definition: rwlock.h:18
int32_t SceInt32
Definition: types.h:44
unsigned int SceSize
Definition: types.h:56
int SceUID
UIDs are used to describe many different kernel objects.
Definition: types.h:90
uint32_t SceUInt32
Definition: types.h:45