RetroArch
mutex.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------
2 
3 mutex.h -- Thread subsystem III
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 __MUTEX_H__
32 #define __MUTEX_H__
33 
39 #include <gctypes.h>
40 
41 #define LWP_MUTEX_NULL 0xffffffff
42 
43 #ifdef __cplusplus
44  extern "C" {
45 #endif
46 
47 
51 typedef u32 mutex_t;
52 
53 
61 s32 LWP_MutexInit(mutex_t *mutex,bool use_recursive);
62 
63 
71 
72 
80 
81 
89 
90 
98 
99 #ifdef __cplusplus
100  }
101 #endif
102 
103 #endif
u32 mutex_t
Definition: mutex.h:51
int32_t s32
32bit signed integer
Definition: gctypes.h:24
int mutex_t
typedef for the mutex handle
Definition: lock.c:6
Data type definitions.
s32 LWP_MutexDestroy(mutex_t mutex)
Close mutex lock, release all threads and handles locked on this mutex.
Definition: mutex.c:122
s32 LWP_MutexLock(mutex_t mutex)
Enter the mutex lock.
Definition: mutex.c:138
s32 LWP_MutexUnlock(mutex_t mutex)
Release the mutex lock and let other threads process further on this mutex.
Definition: mutex.c:148
s32 LWP_MutexTryLock(mutex_t mutex)
Try to enter the mutex lock.
Definition: mutex.c:143
static sys_sem mutex
Definition: memp.c:120
s32 LWP_MutexInit(mutex_t *mutex, bool use_recursive)
Initializes a mutex lock.
Definition: mutex.c:101
uint32_t u32
32bit unsigned integer
Definition: gctypes.h:19