RetroArch
semaphore.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 semaphore.h -- Thread subsystem IV
4 
5 Copyright (C) 2004
6 Michael Wiedenbauer (shagkur)
7 Dave Murphy (WinterMute)
8 
9 This software is provided 'as-is', without any express or implied
10 warranty. In no event will the authors be held liable for any
11 damages arising from the use of this software.
12 
13 Permission is granted to anyone to use this software for any
14 purpose, including commercial applications, and to alter it and
15 redistribute it freely, subject to the following restrictions:
16 
17 1. The origin of this software must not be misrepresented; you
18 must not claim that you wrote the original software. If you use
19 this software in a product, an acknowledgment in the product
20 documentation would be appreciated but is not required.
21 
22 2. Altered source versions must be plainly marked as such, and
23 must not be misrepresented as being the original software.
24 
25 3. This notice may not be removed or altered from any source
26 distribution.
27 
28 -------------------------------------------------------------*/
29 
30 
31 #ifndef __SEMAPHORE_H__
32 #define __SEMAPHORE_H__
33 
40 #include <gctypes.h>
41 
42 #define LWP_SEM_NULL 0xffffffff
43 
44 #ifdef __cplusplus
45 extern "C" {
46 #endif
47 
48 
52 typedef u32 sem_t;
53 
54 
64 
65 
73 
74 
82 
83 
91 
92 #ifdef __cplusplus
93  }
94 #endif
95 
96 #endif
int32_t s32
32bit signed integer
Definition: gctypes.h:24
Data type definitions.
GLuint start
Definition: glext.h:6292
s32 LWP_SemInit(sem_t *sem, u32 start, u32 max)
Initializes a semaphore.
Definition: semaphore.c:88
s32 LWP_SemDestroy(sem_t sem)
Close and destroy a semaphore, release all threads and handles locked on this semaphore.
Definition: semaphore.c:140
struct sem_t_ * sem_t
typedef for the semaphore handle
Definition: semaphore.h:78
s32 LWP_SemPost(sem_t sem)
Count up semaphore counter and release lock if counter >0.
Definition: semaphore.c:129
Definition: implement.h:136
s32 LWP_SemWait(sem_t sem)
Count down semaphore counter and enter lock if counter <=0.
Definition: semaphore.c:107
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19
pte_osSemaphoreHandle sem
Definition: implement.h:140