28
28
extern "C" {
29
29
#endif
30
30
31
+ extern int __mutexUnlock (handle_t m );
32
+ #define mutexUnlock (m ) __mutexUnlock((m))
33
+
34
+ extern int __mutexTry (handle_t m );
35
+ #define mutexTry (m ) __mutexTry((m))
36
+
37
+ #define phMutexLock (m ) mutexLock((m))
38
+
39
+ extern void _uresource_init (void );
40
+
41
+ extern int __resourceDestroy (handle_t r );
42
+ #define resourceDestroy (r ) __resourceDestroy((r))
43
+
44
+ extern int __condBroadcast (handle_t h );
45
+ #define condBroadcast (h ) __condBroadcast((h))
46
+
47
+ extern int __condSignal (handle_t h );
48
+ #define condSignal (h ) __condSignal((h))
49
+
50
+ #define phCondWait (c , m , t ) condWait((c), (m), (t))
31
51
32
52
typedef struct {
33
53
handle_t mutex ;
@@ -73,8 +93,7 @@ extern int threadJoin(int tid, time_t timeout);
73
93
extern int beginthreadex (void (* start )(void * ), unsigned int priority , void * stack , unsigned int stacksz , void * arg , handle_t * id );
74
94
75
95
76
- __attribute__((noreturn ))
77
- extern void endthread (void );
96
+ __attribute__((noreturn )) extern void endthread (void );
78
97
79
98
80
99
static inline int beginthread (void (* start )(void * ), unsigned int priority , void * stack , unsigned int stacksz , void * arg )
@@ -89,33 +108,22 @@ extern int threadsinfo(int n, threadinfo_t *info);
89
108
extern int priority (int priority );
90
109
91
110
92
- extern int phMutexCreate (handle_t * h , const struct lockAttr * attr );
93
-
94
-
95
111
extern int mutexCreate (handle_t * h );
96
112
97
113
98
114
static inline int mutexCreateWithAttr (handle_t * h , const struct lockAttr * attr )
99
115
{
100
- return phMutexCreate (h , attr );
116
+ (void )attr ;
117
+ return mutexCreate (h );
101
118
}
102
119
103
120
104
- extern int phMutexLock (handle_t h );
105
-
106
-
107
121
extern int mutexLock (handle_t h );
108
122
109
123
110
124
extern int mutexLock2 (handle_t h1 , handle_t h2 );
111
125
112
126
113
- extern int mutexTry (handle_t h );
114
-
115
-
116
- extern int mutexUnlock (handle_t h );
117
-
118
-
119
127
extern int semaphoreCreate (semaphore_t * s , unsigned int v );
120
128
121
129
@@ -128,33 +136,19 @@ extern int semaphoreUp(semaphore_t *s);
128
136
extern int semaphoreDone (semaphore_t * s );
129
137
130
138
131
- extern int phCondCreate (handle_t * h , const struct condAttr * attr );
132
-
133
-
134
139
extern int condCreate (handle_t * h );
135
140
136
141
137
142
static inline int condCreateWithAttr (handle_t * h , const struct condAttr * attr )
138
143
{
139
- return phCondCreate (h , attr );
144
+ (void )attr ;
145
+ return condCreate (h );
140
146
}
141
147
142
148
143
149
extern int condWait (handle_t h , handle_t m , time_t timeout );
144
150
145
151
146
- extern int phCondWait (handle_t h , handle_t m , time_t timeout );
147
-
148
-
149
- extern int condSignal (handle_t h );
150
-
151
-
152
- extern int condBroadcast (handle_t h );
153
-
154
-
155
- extern int resourceDestroy (handle_t h );
156
-
157
-
158
152
extern int signalHandle (void (* handler )(void ), unsigned mask , unsigned mmask );
159
153
160
154
0 commit comments