1 #ifndef __SYS_LOCK_H__
2 #define __SYS_LOCK_H__
3 
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 typedef unsigned int _LOCK_T;
10 typedef unsigned int _LOCK_RECURSIVE_T;
11 
12 #define __LOCK_INIT(CLASS,LOCK) CLASS _LOCK_T LOCK = 0;
13 #define __LOCK_INIT_RECURSIVE(CLASS,LOCK) __LOCK_INIT(CLASS,LOCK)
14 
15 #define __lock_init(LOCK) LOCK = 0
16 #define __lock_init_recursive(LOCK) LOCK = 0
17 #define __lock_close(LOCK) ((void)0)
18 #define __lock_close_recursive(LOCK) ((void) 0)
19 #define __lock_acquire(LOCK) __gcn_lock_acquire (&LOCK)
20 #define __lock_acquire_recursive(LOCK) \
21    __gcn_lock_acquire_recursive (&LOCK)
22 #define __lock_try_acquire(LOCK) __gcn_try_lock_acquire (&LOCK)
23 #define __lock_try_acquire_recursive(LOCK) \
24   __gcn_lock_try_acquire_recursive (&LOCK)
25 #define __lock_release(LOCK) __gcn_lock_release (&LOCK)
26 #define __lock_release_recursive(LOCK) \
27   __gcn_lock_release_recursive (&LOCK)
28 
29 
30 int __gcn_try_lock_acquire (_LOCK_T *lock_ptr);
31 void __gcn_lock_acquire (_LOCK_T *lock_ptr);
32 void __gcn_lock_release (_LOCK_T *lock_ptr);
33 int __gcn_lock_try_acquire_recursive (_LOCK_T *lock_ptr);
34 void __gcn_lock_acquire_recursive (_LOCK_T *lock_ptr);
35 void __gcn_lock_release_recursive (_LOCK_T *lock_ptr);
36 
37 #ifdef __cplusplus
38 }
39 #endif
40 
41 #endif /* __SYS_LOCK_H__ */
42