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