]>
Commit | Line | Data |
---|---|---|
1fd5e000 CF |
1 | /* thread.h: Locking and threading module definitions |
2 | ||
b31c68c4 | 3 | Copyright 1998, 1999, 2000, 2001, 2002 Red Hat, Inc. |
1fd5e000 CF |
4 | |
5 | Written by Marco Fuykschot <marco@ddi.nl> | |
9a08b2c0 | 6 | Major update 2001 Robert Collins <rbtcollins@hotmail.com> |
462f4eff | 7 | |
1fd5e000 CF |
8 | This file is part of Cygwin. |
9 | ||
10 | This software is a copyrighted work licensed under the terms of the | |
11 | Cygwin license. Please consult the file "CYGWIN_LICENSE" for | |
12 | details. */ | |
13 | ||
14 | #ifndef _CYGNUS_THREADS_ | |
15 | #define _CYGNUS_THREADS_ | |
16 | ||
17 | #define LOCK_FD_LIST 1 | |
18 | #define LOCK_MEMORY_LIST 2 | |
19 | #define LOCK_MMAP_LIST 3 | |
20 | #define LOCK_DLL_LIST 4 | |
1fd5e000 CF |
21 | |
22 | #define WRITE_LOCK 1 | |
23 | #define READ_LOCK 2 | |
24 | ||
25 | extern "C" | |
26 | { | |
27 | #if defined (_CYG_THREAD_FAILSAFE) && defined (_MT_SAFE) | |
5c83f260 | 28 | void AssertResourceOwner (int, int); |
1fd5e000 | 29 | #else |
f2aeff27 | 30 | #define AssertResourceOwner(i,ii) |
1fd5e000 CF |
31 | #endif |
32 | } | |
33 | ||
34 | #ifndef _MT_SAFE | |
35 | ||
36 | #define SetResourceLock(i,n,c) | |
37 | #define ReleaseResourceLock(i,n,c) | |
38 | ||
39 | #else | |
40 | ||
5c83f260 | 41 | #include <pthread.h> |
9a08b2c0 | 42 | #include <signal.h> |
1fd5e000 CF |
43 | #include <pwd.h> |
44 | #include <grp.h> | |
bccd5e0d | 45 | #define _NOMNTENT_FUNCS |
1fd5e000 | 46 | #include <mntent.h> |
1fd5e000 | 47 | |
9a08b2c0 | 48 | extern "C" |
1fd5e000 | 49 | { |
9a08b2c0 | 50 | |
f2aeff27 CF |
51 | struct _winsup_t |
52 | { | |
53 | /* | |
5c83f260 RC |
54 | Needed for the group functions |
55 | */ | |
de4e0d30 | 56 | struct __group16 _grp; |
f2aeff27 CF |
57 | char *_namearray[2]; |
58 | int _grp_pos; | |
59 | ||
60 | /* console.cc */ | |
61 | unsigned _rarg; | |
62 | ||
63 | /* dlfcn.cc */ | |
64 | int _dl_error; | |
65 | char _dl_buffer[256]; | |
66 | ||
67 | /* passwd.cc */ | |
68 | struct passwd _res; | |
69 | char _pass[_PASSWORD_LEN]; | |
70 | int _pw_pos; | |
71 | ||
72 | /* path.cc */ | |
73 | struct mntent mntbuf; | |
74 | int _iteration; | |
75 | DWORD available_drives; | |
f97adf98 CF |
76 | char mnt_type[80]; |
77 | char mnt_opts[80]; | |
78 | char mnt_fsname[MAX_PATH]; | |
79 | char mnt_dir[MAX_PATH]; | |
f2aeff27 CF |
80 | |
81 | /* strerror */ | |
82 | char _strerror_buf[20]; | |
83 | ||
84 | /* sysloc.cc */ | |
85 | char *_process_ident; | |
86 | int _process_logopt; | |
87 | int _process_facility; | |
88 | int _process_logmask; | |
89 | ||
90 | /* times.cc */ | |
91 | char timezone_buf[20]; | |
92 | struct tm _localtime_buf; | |
93 | ||
94 | /* uinfo.cc */ | |
17db1105 | 95 | char _username[UNLEN + 1]; |
cb19ccf4 CV |
96 | |
97 | /* net.cc */ | |
98 | char *_ntoa_buf; | |
99 | struct protoent *_protoent_buf; | |
100 | struct servent *_servent_buf; | |
101 | struct hostent *_hostent_buf; | |
f2aeff27 CF |
102 | }; |
103 | ||
104 | ||
105 | struct __reent_t | |
106 | { | |
107 | struct _reent *_clib; | |
108 | struct _winsup_t *_winsup; | |
109 | }; | |
1fd5e000 | 110 | |
f2aeff27 CF |
111 | _reent *_reent_clib (); |
112 | _winsup_t *_reent_winsup (); | |
113 | void SetResourceLock (int, int, const char *) __attribute__ ((regparm (3))); | |
114 | void ReleaseResourceLock (int, int, const char *) | |
115 | __attribute__ ((regparm (3))); | |
1fd5e000 CF |
116 | |
117 | #ifdef _CYG_THREAD_FAILSAFE | |
f2aeff27 | 118 | void AssertResourceOwner (int, int); |
1fd5e000 CF |
119 | #else |
120 | #define AssertResourceOwner(i,ii) | |
121 | #endif | |
122 | } | |
123 | ||
124 | class per_process; | |
125 | class pinfo; | |
126 | ||
127 | class ResourceLocks | |
128 | { | |
129 | public: | |
5c83f260 RC |
130 | ResourceLocks () |
131 | { | |
132 | } | |
1dc16fc7 CF |
133 | LPCRITICAL_SECTION Lock (int); |
134 | void Init (); | |
135 | void Delete (); | |
1fd5e000 | 136 | #ifdef _CYG_THREAD_FAILSAFE |
1dc16fc7 CF |
137 | DWORD owner; |
138 | DWORD count; | |
1fd5e000 | 139 | #endif |
9a08b2c0 | 140 | private: |
1dc16fc7 CF |
141 | CRITICAL_SECTION lock; |
142 | bool inited; | |
1fd5e000 CF |
143 | }; |
144 | ||
9a08b2c0 CF |
145 | #define PTHREAD_MAGIC 0xdf0df045 |
146 | #define PTHREAD_MUTEX_MAGIC PTHREAD_MAGIC+1 | |
147 | #define PTHREAD_KEY_MAGIC PTHREAD_MAGIC+2 | |
148 | #define PTHREAD_ATTR_MAGIC PTHREAD_MAGIC+3 | |
149 | #define PTHREAD_MUTEXATTR_MAGIC PTHREAD_MAGIC+4 | |
150 | #define PTHREAD_COND_MAGIC PTHREAD_MAGIC+5 | |
151 | #define PTHREAD_CONDATTR_MAGIC PTHREAD_MAGIC+6 | |
152 | #define SEM_MAGIC PTHREAD_MAGIC+7 | |
5c83f260 RC |
153 | #define PTHREAD_ONCE_MAGIC PTHREAD_MAGIC+8; |
154 | ||
155 | /* verifyable_object should not be defined here - it's a general purpose class */ | |
1fd5e000 | 156 | |
9a08b2c0 CF |
157 | class verifyable_object |
158 | { | |
159 | public: | |
160 | long magic; | |
1fd5e000 | 161 | |
5c83f260 RC |
162 | verifyable_object (long); |
163 | ~verifyable_object (); | |
9a08b2c0 CF |
164 | }; |
165 | ||
9c510edc | 166 | typedef enum |
86336f4f RC |
167 | { |
168 | VALID_OBJECT, | |
169 | INVALID_OBJECT, | |
170 | VALID_STATIC_OBJECT | |
171 | } verifyable_object_state; | |
172 | ||
173 | verifyable_object_state verifyable_object_isvalid (void const *, long); | |
174 | verifyable_object_state verifyable_object_isvalid (void const *, long, void *); | |
1fd5e000 | 175 | |
5c83f260 RC |
176 | class pthread_key:public verifyable_object |
177 | { | |
178 | public: | |
179 | ||
180 | DWORD dwTlsIndex; | |
181 | int set (const void *); | |
182 | void *get (); | |
183 | ||
184 | pthread_key (void (*)(void *)); | |
185 | ~pthread_key (); | |
186 | }; | |
187 | ||
188 | /* FIXME: test using multiple inheritance and merging key_destructor into pthread_key | |
189 | * for efficiency */ | |
190 | class pthread_key_destructor | |
191 | { | |
192 | public: | |
193 | void (*destructor) (void *); | |
194 | pthread_key_destructor *InsertAfter (pthread_key_destructor * node); | |
195 | pthread_key_destructor *UnlinkNext (); | |
196 | pthread_key_destructor *Next (); | |
197 | ||
198 | pthread_key_destructor (void (*thedestructor) (void *), pthread_key * key); | |
199 | pthread_key_destructor *next; | |
200 | pthread_key *key; | |
201 | }; | |
202 | ||
203 | class pthread_key_destructor_list | |
204 | { | |
205 | public: | |
206 | void Insert (pthread_key_destructor * node); | |
207 | /* remove a given dataitem, wherever in the list it is */ | |
208 | pthread_key_destructor *Remove (pthread_key_destructor * item); | |
209 | /* get the first item and remove at the same time */ | |
210 | pthread_key_destructor *Pop (); | |
211 | pthread_key_destructor *Remove (pthread_key * key); | |
212 | void IterateNull (); | |
213 | private: | |
214 | pthread_key_destructor * head; | |
215 | }; | |
216 | ||
217 | ||
9a08b2c0 | 218 | class pthread_attr:public verifyable_object |
1fd5e000 | 219 | { |
9a08b2c0 CF |
220 | public: |
221 | int joinable; | |
5c83f260 RC |
222 | int contentionscope; |
223 | int inheritsched; | |
224 | struct sched_param schedparam; | |
9a08b2c0 CF |
225 | size_t stacksize; |
226 | ||
5c83f260 RC |
227 | pthread_attr (); |
228 | ~pthread_attr (); | |
1fd5e000 CF |
229 | }; |
230 | ||
43c3c4e3 RC |
231 | class pthread_mutexattr:public verifyable_object |
232 | { | |
233 | public: | |
234 | int pshared; | |
235 | int mutextype; | |
236 | pthread_mutexattr (); | |
237 | ~pthread_mutexattr (); | |
238 | }; | |
239 | ||
240 | class pthread_mutex:public verifyable_object | |
241 | { | |
242 | public: | |
243 | CRITICAL_SECTION criticalsection; | |
244 | HANDLE win32_obj_id; | |
245 | LONG condwaits; | |
246 | int pshared; | |
247 | class pthread_mutex * next; | |
248 | ||
249 | int Lock (); | |
250 | int TryLock (); | |
251 | int UnLock (); | |
252 | void fixup_after_fork (); | |
253 | ||
254 | pthread_mutex (pthread_mutexattr * = NULL); | |
255 | pthread_mutex (pthread_mutex_t *, pthread_mutexattr *); | |
256 | ~pthread_mutex (); | |
257 | }; | |
258 | ||
9a08b2c0 | 259 | class pthread:public verifyable_object |
1fd5e000 CF |
260 | { |
261 | public: | |
9a08b2c0 CF |
262 | HANDLE win32_obj_id; |
263 | class pthread_attr attr; | |
264 | void *(*function) (void *); | |
1dc16fc7 CF |
265 | void *arg; |
266 | void *return_ptr; | |
267 | bool suspended; | |
5c83f260 | 268 | int cancelstate, canceltype; |
d288c1c7 | 269 | HANDLE cancel_event; |
e9259cb2 | 270 | pthread_t joiner; |
5c83f260 RC |
271 | // int joinable; |
272 | ||
9a08b2c0 CF |
273 | DWORD GetThreadId () |
274 | { | |
275 | return thread_id; | |
276 | } | |
277 | void setThreadIdtoCurrent () | |
278 | { | |
279 | thread_id = GetCurrentThreadId (); | |
280 | } | |
1dc16fc7 CF |
281 | |
282 | /* signal handling */ | |
283 | struct sigaction *sigs; | |
284 | sigset_t *sigmask; | |
285 | LONG *sigtodo; | |
9a08b2c0 CF |
286 | void create (void *(*)(void *), pthread_attr *, void *); |
287 | ||
5c83f260 RC |
288 | pthread (); |
289 | ~pthread (); | |
9a08b2c0 | 290 | |
d288c1c7 RC |
291 | void exit (void *value_ptr); |
292 | ||
293 | int cancel (); | |
294 | void testcancel (); | |
295 | void cancel_self () | |
296 | { | |
297 | exit (PTHREAD_CANCELED); | |
298 | } | |
299 | static void static_cancel_self (); | |
300 | ||
301 | int setcancelstate (int state, int *oldstate); | |
302 | int setcanceltype (int type, int *oldtype); | |
303 | ||
007276b3 RC |
304 | void push_cleanup_handler (__pthread_cleanup_handler *handler); |
305 | void pop_cleanup_handler (int const execute); | |
306 | ||
307 | static pthread* self (); | |
43c3c4e3 | 308 | static void *thread_init_wrapper (void *); |
007276b3 | 309 | |
9a08b2c0 | 310 | private: |
5c83f260 | 311 | DWORD thread_id; |
f6709c07 | 312 | __pthread_cleanup_handler *cleanup_stack; |
43c3c4e3 | 313 | pthread_mutex mutex; |
007276b3 | 314 | |
43c3c4e3 RC |
315 | friend int __pthread_join (pthread_t * thread, void **return_val); |
316 | friend int __pthread_detach (pthread_t * thread); | |
077d8b23 | 317 | |
007276b3 | 318 | void pop_all_cleanup_handlers (void); |
1fd5e000 CF |
319 | }; |
320 | ||
9a08b2c0 | 321 | class pthread_condattr:public verifyable_object |
1fd5e000 CF |
322 | { |
323 | public: | |
1dc16fc7 | 324 | int shared; |
9a08b2c0 | 325 | |
462f4eff CF |
326 | pthread_condattr (); |
327 | ~pthread_condattr (); | |
1fd5e000 CF |
328 | }; |
329 | ||
9a08b2c0 | 330 | class pthread_cond:public verifyable_object |
5ccbf4b6 CF |
331 | { |
332 | public: | |
333 | int shared; | |
334 | LONG waiting; | |
cbce4980 | 335 | LONG ExitingWait; |
9a08b2c0 | 336 | pthread_mutex *mutex; |
68ebd3f6 RC |
337 | /* to allow atomic behaviour for cond_broadcast */ |
338 | pthread_mutex_t cond_access; | |
9a08b2c0 | 339 | HANDLE win32_obj_id; |
f9229ef7 | 340 | class pthread_cond * next; |
5ccbf4b6 | 341 | int TimedWait (DWORD dwMilliseconds); |
9a08b2c0 CF |
342 | void BroadCast (); |
343 | void Signal (); | |
f9229ef7 | 344 | void fixup_after_fork (); |
9a08b2c0 | 345 | |
5c83f260 RC |
346 | pthread_cond (pthread_condattr *); |
347 | ~pthread_cond (); | |
348 | }; | |
349 | ||
350 | class pthread_once | |
351 | { | |
352 | public: | |
353 | pthread_mutex_t mutex; | |
354 | int state; | |
5ccbf4b6 | 355 | }; |
1fd5e000 | 356 | |
9a08b2c0 CF |
357 | /* shouldn't be here */ |
358 | class semaphore:public verifyable_object | |
1fd5e000 | 359 | { |
9a08b2c0 CF |
360 | public: |
361 | HANDLE win32_obj_id; | |
f9229ef7 | 362 | class semaphore * next; |
9a08b2c0 | 363 | int shared; |
f9229ef7 | 364 | long currentvalue; |
9a08b2c0 CF |
365 | void Wait (); |
366 | void Post (); | |
367 | int TryWait (); | |
f9229ef7 | 368 | void fixup_after_fork (); |
9a08b2c0 | 369 | |
5c83f260 RC |
370 | semaphore (int, unsigned int); |
371 | ~semaphore (); | |
9a08b2c0 CF |
372 | }; |
373 | ||
39b6859a CF |
374 | class callback |
375 | { | |
376 | public: | |
377 | void (*cb)(void); | |
378 | class callback * next; | |
379 | }; | |
380 | ||
1fd5e000 CF |
381 | class MTinterface |
382 | { | |
383 | public: | |
1dc16fc7 CF |
384 | // General |
385 | DWORD reent_index; | |
9a08b2c0 CF |
386 | DWORD thread_self_dwTlsIndex; |
387 | /* we may get 0 for the Tls index.. grrr */ | |
388 | int indexallocated; | |
5c83f260 | 389 | int concurrency; |
e6b98fc8 | 390 | long int threadcount; |
1fd5e000 | 391 | |
1dc16fc7 CF |
392 | // Used for main thread data, and sigproc thread |
393 | struct __reent_t reents; | |
394 | struct _winsup_t winsup_reent; | |
9a08b2c0 | 395 | pthread mainthread; |
1fd5e000 | 396 | |
5c83f260 | 397 | pthread_key_destructor_list destructors; |
39b6859a CF |
398 | callback *pthread_prepare; |
399 | callback *pthread_child; | |
400 | callback *pthread_parent; | |
5c83f260 | 401 | |
ac9841a0 RC |
402 | // list of mutex's. USE THREADSAFE INSERTS AND DELETES. |
403 | class pthread_mutex * mutexs; | |
f9229ef7 RC |
404 | class pthread_cond * conds; |
405 | class semaphore * semaphores; | |
9450ad0d | 406 | |
166b2571 | 407 | void Init (int); |
f9229ef7 | 408 | void fixup_after_fork (void); |
1fd5e000 | 409 | |
077d8b23 CF |
410 | MTinterface ():reent_index (0), indexallocated (0), threadcount (1) |
411 | { | |
412 | pthread_prepare = NULL; | |
413 | pthread_child = NULL; | |
414 | pthread_parent = NULL; | |
415 | } | |
1fd5e000 CF |
416 | }; |
417 | ||
39b6859a CF |
418 | void __pthread_atforkprepare(void); |
419 | void __pthread_atforkparent(void); | |
420 | void __pthread_atforkchild(void); | |
1fd5e000 | 421 | |
d288c1c7 RC |
422 | /* Cancellation */ |
423 | int __pthread_cancel (pthread_t thread); | |
424 | ||
007276b3 | 425 | /* Thread Exit */ |
007276b3 RC |
426 | int __pthread_join (pthread_t * thread, void **return_val); |
427 | int __pthread_detach (pthread_t * thread); | |
428 | ||
1fd5e000 CF |
429 | extern "C" |
430 | { | |
1fd5e000 | 431 | /* ThreadCreation */ |
5c83f260 RC |
432 | int __pthread_create (pthread_t * thread, const pthread_attr_t * attr, |
433 | void *(*start_routine) (void *), void *arg); | |
434 | int __pthread_once (pthread_once_t *, void (*)(void)); | |
39b6859a | 435 | int __pthread_atfork(void (*)(void), void (*)(void), void (*)(void)); |
5c83f260 RC |
436 | |
437 | int __pthread_attr_init (pthread_attr_t * attr); | |
438 | int __pthread_attr_destroy (pthread_attr_t * attr); | |
439 | int __pthread_attr_setdetachstate (pthread_attr_t *, int); | |
440 | int __pthread_attr_getdetachstate (const pthread_attr_t *, int *); | |
441 | int __pthread_attr_setstacksize (pthread_attr_t * attr, size_t size); | |
442 | int __pthread_attr_getstacksize (const pthread_attr_t * attr, size_t * size); | |
443 | ||
444 | int __pthread_attr_getinheritsched (const pthread_attr_t *, int *); | |
445 | int __pthread_attr_getschedparam (const pthread_attr_t *, | |
446 | struct sched_param *); | |
447 | int __pthread_attr_getschedpolicy (const pthread_attr_t *, int *); | |
448 | int __pthread_attr_getscope (const pthread_attr_t *, int *); | |
449 | int __pthread_attr_getstackaddr (const pthread_attr_t *, void **); | |
450 | int __pthread_attr_setinheritsched (pthread_attr_t *, int); | |
451 | int __pthread_attr_setschedparam (pthread_attr_t *, | |
452 | const struct sched_param *); | |
453 | int __pthread_attr_setschedpolicy (pthread_attr_t *, int); | |
454 | int __pthread_attr_setscope (pthread_attr_t *, int); | |
455 | int __pthread_attr_setstackaddr (pthread_attr_t *, void *); | |
456 | ||
1fd5e000 | 457 | /* Thread suspend */ |
5c83f260 RC |
458 | int __pthread_suspend (pthread_t * thread); |
459 | int __pthread_continue (pthread_t * thread); | |
1fd5e000 | 460 | |
5c83f260 | 461 | unsigned long __pthread_getsequence_np (pthread_t * thread); |
1fd5e000 CF |
462 | |
463 | /* Thread SpecificData */ | |
5c83f260 RC |
464 | int __pthread_key_create (pthread_key_t * key, void (*destructor) (void *)); |
465 | int __pthread_key_delete (pthread_key_t key); | |
466 | int __pthread_setspecific (pthread_key_t key, const void *value); | |
467 | void *__pthread_getspecific (pthread_key_t key); | |
1fd5e000 | 468 | |
5ccbf4b6 | 469 | /* Thead synchroniation */ |
5c83f260 RC |
470 | int __pthread_cond_destroy (pthread_cond_t * cond); |
471 | int __pthread_cond_init (pthread_cond_t * cond, | |
472 | const pthread_condattr_t * attr); | |
473 | int __pthread_cond_signal (pthread_cond_t * cond); | |
474 | int __pthread_cond_broadcast (pthread_cond_t * cond); | |
5c83f260 RC |
475 | int __pthread_condattr_init (pthread_condattr_t * condattr); |
476 | int __pthread_condattr_destroy (pthread_condattr_t * condattr); | |
477 | int __pthread_condattr_getpshared (const pthread_condattr_t * attr, | |
478 | int *pshared); | |
479 | int __pthread_condattr_setpshared (pthread_condattr_t * attr, int pshared); | |
1fd5e000 CF |
480 | |
481 | /* Thread signal */ | |
5c83f260 RC |
482 | int __pthread_kill (pthread_t thread, int sig); |
483 | int __pthread_sigmask (int operation, const sigset_t * set, | |
484 | sigset_t * old_set); | |
1fd5e000 CF |
485 | |
486 | /* ID */ | |
5c83f260 | 487 | int __pthread_equal (pthread_t * t1, pthread_t * t2); |
1fd5e000 | 488 | |
1fd5e000 | 489 | /* Mutexes */ |
5c83f260 RC |
490 | int __pthread_mutex_init (pthread_mutex_t *, const pthread_mutexattr_t *); |
491 | int __pthread_mutex_lock (pthread_mutex_t *); | |
492 | int __pthread_mutex_trylock (pthread_mutex_t *); | |
493 | int __pthread_mutex_unlock (pthread_mutex_t *); | |
494 | int __pthread_mutex_destroy (pthread_mutex_t *); | |
495 | int __pthread_mutex_setprioceiling (pthread_mutex_t * mutex, | |
496 | int prioceiling, int *old_ceiling); | |
497 | int __pthread_mutex_getprioceiling (const pthread_mutex_t * mutex, | |
498 | int *prioceiling); | |
499 | ||
500 | ||
501 | int __pthread_mutexattr_destroy (pthread_mutexattr_t *); | |
502 | int __pthread_mutexattr_getprioceiling (const pthread_mutexattr_t *, int *); | |
503 | int __pthread_mutexattr_getprotocol (const pthread_mutexattr_t *, int *); | |
504 | int __pthread_mutexattr_getpshared (const pthread_mutexattr_t *, int *); | |
505 | int __pthread_mutexattr_gettype (const pthread_mutexattr_t *, int *); | |
506 | int __pthread_mutexattr_init (pthread_mutexattr_t *); | |
507 | int __pthread_mutexattr_setprioceiling (pthread_mutexattr_t *, int); | |
508 | int __pthread_mutexattr_setprotocol (pthread_mutexattr_t *, int); | |
509 | int __pthread_mutexattr_setpshared (pthread_mutexattr_t *, int); | |
510 | int __pthread_mutexattr_settype (pthread_mutexattr_t *, int); | |
511 | ||
512 | ||
513 | /* Scheduling */ | |
514 | int __pthread_getconcurrency (void); | |
515 | int __pthread_setconcurrency (int new_level); | |
516 | int __pthread_getschedparam (pthread_t thread, int *policy, | |
517 | struct sched_param *param); | |
518 | int __pthread_setschedparam (pthread_t thread, int policy, | |
519 | const struct sched_param *param); | |
520 | ||
521 | /* cancelability states */ | |
5c83f260 | 522 | |
1fd5e000 | 523 | /* Semaphores */ |
5c83f260 RC |
524 | int __sem_init (sem_t * sem, int pshared, unsigned int value); |
525 | int __sem_destroy (sem_t * sem); | |
526 | int __sem_wait (sem_t * sem); | |
527 | int __sem_trywait (sem_t * sem); | |
528 | int __sem_post (sem_t * sem); | |
1fd5e000 CF |
529 | }; |
530 | ||
b0e82b74 | 531 | #endif // MT_SAFE |
1fd5e000 | 532 | |
b0e82b74 | 533 | #endif // _CYGNUS_THREADS_ |