]> git.llucax.com Git - software/druntime.git/blob - import/core/sys/posix/pthread.d
Fixed 64-bit prototype for dirent_r routine.
[software/druntime.git] / import / core / sys / posix / pthread.d
1 /**
2  * D header file for POSIX.
3  *
4  * Copyright: Public Domain
5  * License:   Public Domain
6  * Authors:   Sean Kelly
7  * Standards: The Open Group Base Specifications Issue 6, IEEE Std 1003.1, 2004 Edition
8  */
9 module core.sys.posix.pthread;
10
11 private import core.sys.posix.config;
12 public import core.sys.posix.sys.types;
13 public import core.sys.posix.sched;
14 public import core.sys.posix.time;
15
16 extern (C):
17
18 //
19 // Required
20 //
21 /*
22 PTHREAD_CANCEL_ASYNCHRONOUS
23 PTHREAD_CANCEL_ENABLE
24 PTHREAD_CANCEL_DEFERRED
25 PTHREAD_CANCEL_DISABLE
26 PTHREAD_CANCELED
27 PTHREAD_COND_INITIALIZER
28 PTHREAD_CREATE_DETACHED
29 PTHREAD_CREATE_JOINABLE
30 PTHREAD_EXPLICIT_SCHED
31 PTHREAD_INHERIT_SCHED
32 PTHREAD_MUTEX_INITIALIZER
33 PTHREAD_ONCE_INIT
34 PTHREAD_PROCESS_SHARED
35 PTHREAD_PROCESS_PRIVATE
36
37 int pthread_atfork(void function(), void function(), void function());
38 int pthread_attr_destroy(pthread_attr_t*);
39 int pthread_attr_getdetachstate(in pthread_attr_t*, int*);
40 int pthread_attr_getschedparam(in pthread_attr_t*, sched_param*);
41 int pthread_attr_init(pthread_attr_t*);
42 int pthread_attr_setdetachstate(pthread_attr_t*, int);
43 int pthread_attr_setschedparam(in pthread_attr_t*, sched_param*);
44 int pthread_cancel(pthread_t);
45 void pthread_cleanup_push(void function(void*), void*);
46 void pthread_cleanup_pop(int);
47 int pthread_cond_broadcast(pthread_cond_t*);
48 int pthread_cond_destroy(pthread_cond_t*);
49 int pthread_cond_init(in pthread_cond_t*, pthread_condattr_t*);
50 int pthread_cond_signal(pthread_cond_t*);
51 int pthread_cond_timedwait(pthread_cond_t*, pthread_mutex_t*, in timespec*);
52 int pthread_cond_wait(pthread_cond_t*, pthread_mutex_t*);
53 int pthread_condattr_destroy(pthread_condattr_t*);
54 int pthread_condattr_init(pthread_condattr_t*);
55 int pthread_create(pthread_t*, in pthread_attr_t*, void* function(void*), void*);
56 int pthread_detach(pthread_t);
57 int pthread_equal(pthread_t, pthread_t);
58 void pthread_exit(void*);
59 void* pthread_getspecific(pthread_key_t);
60 int pthread_join(pthread_t, void**);
61 int pthread_key_create(pthread_key_t*, void function(void*));
62 int pthread_key_delete(pthread_key_t);
63 int pthread_mutex_destroy(pthread_mutex_t*);
64 int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t*);
65 int pthread_mutex_lock(pthread_mutex_t*);
66 int pthread_mutex_trylock(pthread_mutex_t*);
67 int pthread_mutex_unlock(pthread_mutex_t*);
68 int pthread_mutexattr_destroy(pthread_mutexattr_t*);
69 int pthread_mutexattr_init(pthread_mutexattr_t*);
70 int pthread_once(pthread_once_t*, void function());
71 int pthread_rwlock_destroy(pthread_rwlock_t*);
72 int pthread_rwlock_init(in pthread_rwlock_t*, pthread_rwlockattr_t*);
73 int pthread_rwlock_rdlock(pthread_rwlock_t*);
74 int pthread_rwlock_tryrdlock(pthread_rwlock_t*);
75 int pthread_rwlock_trywrlock(pthread_rwlock_t*);
76 int pthread_rwlock_unlock(pthread_rwlock_t*);
77 int pthread_rwlock_wrlock(pthread_rwlock_t*);
78 int pthread_rwlockattr_destroy(pthread_rwlockattr_t*);
79 int pthread_rwlockattr_init(pthread_rwlockattr_t*);
80 pthread_t pthread_self();
81 int pthread_setcancelstate(int, int*);
82 int pthread_setcanceltype(int, int*);
83 int pthread_setspecific(pthread_key_t, in void*);
84 void pthread_testcancel();
85 */
86 version( linux )
87 {
88     enum
89     {
90         PTHREAD_CANCEL_ENABLE,
91         PTHREAD_CANCEL_DISABLE
92     }
93
94     enum
95     {
96         PTHREAD_CANCEL_DEFERRED,
97         PTHREAD_CANCEL_ASYNCHRONOUS
98     }
99
100     const PTHREAD_CANCELED = cast(void*) -1;
101
102     //const pthread_mutex_t PTHREAD_COND_INITIALIZER = { __LOCK_ALT_INITIALIZER, 0, "", 0 };
103
104     enum
105     {
106         PTHREAD_CREATE_JOINABLE,
107         PTHREAD_CREATE_DETACHED
108     }
109
110     enum
111     {
112         PTHREAD_INHERIT_SCHED,
113         PTHREAD_EXPLICIT_SCHED
114     }
115
116     //const pthread_mutex_t PTHREAD_MUTEX_INITIALIZER = { 0, 0, null, PTHREAD_MUTEX_NORMAL, { 0, 0 } };
117
118     const PTHREAD_ONCE_INIT = 0;
119
120     enum
121     {
122         PTHREAD_PROCESS_PRIVATE,
123         PTHREAD_PROCESS_SHARED
124     }
125 }
126 else version( darwin )
127 {
128     enum
129     {
130         PTHREAD_CANCEL_ENABLE   = 1,
131         PTHREAD_CANCEL_DISABLE  = 0
132     }
133
134     enum
135     {
136         PTHREAD_CANCEL_DEFERRED     = 2,
137         PTHREAD_CANCEL_ASYNCHRONOUS = 0
138     }
139
140     const PTHREAD_CANCELED = cast(void*) -1;
141
142     //const pthread_mutex_t PTHREAD_COND_INITIALIZER = { __LOCK_ALT_INITIALIZER, 0, "", 0 };
143
144     enum
145     {
146         PTHREAD_CREATE_JOINABLE = 1,
147         PTHREAD_CREATE_DETACHED = 2
148     }
149
150     enum
151     {
152         PTHREAD_INHERIT_SCHED   = 1,
153         PTHREAD_EXPLICIT_SCHED  = 2
154     }
155
156     //const pthread_mutex_t PTHREAD_MUTEX_INITIALIZER = { 0, 0, null, PTHREAD_MUTEX_NORMAL, { 0, 0 } };
157
158     const PTHREAD_ONCE_INIT = 0;
159
160     enum
161     {
162         PTHREAD_PROCESS_PRIVATE = 2,
163         PTHREAD_PROCESS_SHARED  = 1
164     }
165 }
166
167 int pthread_atfork(void function(), void function(), void function());
168 int pthread_attr_destroy(pthread_attr_t*);
169 int pthread_attr_getdetachstate(in pthread_attr_t*, int*);
170 int pthread_attr_getschedparam(in pthread_attr_t*, sched_param*);
171 int pthread_attr_init(pthread_attr_t*);
172 int pthread_attr_setdetachstate(pthread_attr_t*, int);
173 int pthread_attr_setschedparam(in pthread_attr_t*, sched_param*);
174 int pthread_cancel(pthread_t);
175
176 version( linux )
177 {
178     alias void function(void*) _pthread_cleanup_routine;
179
180     struct _pthread_cleanup_buffer
181     {
182         _pthread_cleanup_routine    __routine;
183         void*                       __arg;
184         int                         __canceltype;
185         _pthread_cleanup_buffer*    __prev;
186     }
187
188     void _pthread_cleanup_push(_pthread_cleanup_buffer*, _pthread_cleanup_routine, void*);
189     void _pthread_cleanup_pop(_pthread_cleanup_buffer*, int);
190
191     struct pthread_cleanup
192     {
193         _pthread_cleanup_buffer buffer = void;
194
195         void push()( _pthread_cleanup_routine routine, void* arg )
196         {
197             _pthread_cleanup_push( &buffer, routine, arg );
198         }
199
200         void pop()( int execute )
201         {
202             _pthread_cleanup_pop( &buffer, execute );
203         }
204     }
205 }
206 else version( darwin )
207 {
208     alias void function(void*) _pthread_cleanup_routine;
209
210     struct _pthread_cleanup_buffer
211     {
212         _pthread_cleanup_routine    __routine;
213         void*                       __arg;
214         _pthread_cleanup_buffer*    __next;
215     }
216
217     struct pthread_cleanup
218     {
219         _pthread_cleanup_buffer buffer = void;
220
221         void push()( _pthread_cleanup_routine routine, void* arg )
222         {
223             pthread_t self       = pthread_self();
224             buffer.__routine     = routine;
225             buffer.__arg         = arg;
226             buffer.__next        = cast(_pthread_cleanup_buffer*) self.__cleanup_stack;
227             self.__cleanup_stack = cast(pthread_handler_rec*) &buffer;
228         }
229
230         void pop()( int execute )
231         {
232             pthread_t self       = pthread_self();
233             self.__cleanup_stack = cast(pthread_handler_rec*) buffer.__next;
234             if( execute )
235             {
236                 buffer.__routine( buffer.__arg );
237             }
238         }
239     }
240 }
241 else
242 {
243     void pthread_cleanup_push(void function(void*), void*);
244     void pthread_cleanup_pop(int);
245 }
246
247 int pthread_cond_broadcast(pthread_cond_t*);
248 int pthread_cond_destroy(pthread_cond_t*);
249 int pthread_cond_init(in pthread_cond_t*, pthread_condattr_t*);
250 int pthread_cond_signal(pthread_cond_t*);
251 int pthread_cond_timedwait(pthread_cond_t*, pthread_mutex_t*, in timespec*);
252 int pthread_cond_wait(pthread_cond_t*, pthread_mutex_t*);
253 int pthread_condattr_destroy(pthread_condattr_t*);
254 int pthread_condattr_init(pthread_condattr_t*);
255 int pthread_create(pthread_t*, in pthread_attr_t*, void* function(void*), void*);
256 int pthread_detach(pthread_t);
257 int pthread_equal(pthread_t, pthread_t);
258 void pthread_exit(void*);
259 void* pthread_getspecific(pthread_key_t);
260 int pthread_join(pthread_t, void**);
261 int pthread_key_create(pthread_key_t*, void function(void*));
262 int pthread_key_delete(pthread_key_t);
263 int pthread_mutex_destroy(pthread_mutex_t*);
264 int pthread_mutex_init(pthread_mutex_t*, pthread_mutexattr_t*);
265 int pthread_mutex_lock(pthread_mutex_t*);
266 int pthread_mutex_trylock(pthread_mutex_t*);
267 int pthread_mutex_unlock(pthread_mutex_t*);
268 int pthread_mutexattr_destroy(pthread_mutexattr_t*);
269 int pthread_mutexattr_init(pthread_mutexattr_t*);
270 int pthread_once(pthread_once_t*, void function());
271 int pthread_rwlock_destroy(pthread_rwlock_t*);
272 int pthread_rwlock_init(in pthread_rwlock_t*, pthread_rwlockattr_t*);
273 int pthread_rwlock_rdlock(pthread_rwlock_t*);
274 int pthread_rwlock_tryrdlock(pthread_rwlock_t*);
275 int pthread_rwlock_trywrlock(pthread_rwlock_t*);
276 int pthread_rwlock_unlock(pthread_rwlock_t*);
277 int pthread_rwlock_wrlock(pthread_rwlock_t*);
278 int pthread_rwlockattr_destroy(pthread_rwlockattr_t*);
279 int pthread_rwlockattr_init(pthread_rwlockattr_t*);
280 pthread_t pthread_self();
281 int pthread_setcancelstate(int, int*);
282 int pthread_setcanceltype(int, int*);
283 int pthread_setspecific(pthread_key_t, in void*);
284 void pthread_testcancel();
285
286 //
287 // Barrier (BAR)
288 //
289 /*
290 PTHREAD_BARRIER_SERIAL_THREAD
291
292 int pthread_barrier_destroy(pthread_barrier_t*);
293 int pthread_barrier_init(pthread_barrier_t*, in pthread_barrierattr_t*, uint);
294 int pthread_barrier_wait(pthread_barrier_t*);
295 int pthread_barrierattr_destroy(pthread_barrierattr_t*);
296 int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, int*); (BAR|TSH)
297 int pthread_barrierattr_init(pthread_barrierattr_t*);
298 int pthread_barrierattr_setpshared(pthread_barrierattr_t*, int); (BAR|TSH)
299 */
300
301 version( linux )
302 {
303     const PTHREAD_BARRIER_SERIAL_THREAD = -1;
304
305     int pthread_barrier_destroy(pthread_barrier_t*);
306     int pthread_barrier_init(pthread_barrier_t*, in pthread_barrierattr_t*, uint);
307     int pthread_barrier_wait(pthread_barrier_t*);
308     int pthread_barrierattr_destroy(pthread_barrierattr_t*);
309     int pthread_barrierattr_getpshared(in pthread_barrierattr_t*, int*);
310     int pthread_barrierattr_init(pthread_barrierattr_t*);
311     int pthread_barrierattr_setpshared(pthread_barrierattr_t*, int);
312 }
313
314 //
315 // Clock (CS)
316 //
317 /*
318 int pthread_condattr_getclock(in pthread_condattr_t*, clockid_t*);
319 int pthread_condattr_setclock(pthread_condattr_t*, clockid_t);
320 */
321
322 //
323 // Spinlock (SPI)
324 //
325 /*
326 int pthread_spin_destroy(pthread_spinlock_t*);
327 int pthread_spin_init(pthread_spinlock_t*, int);
328 int pthread_spin_lock(pthread_spinlock_t*);
329 int pthread_spin_trylock(pthread_spinlock_t*);
330 int pthread_spin_unlock(pthread_spinlock_t*);
331 */
332
333 version( linux )
334 {
335     int pthread_spin_destroy(pthread_spinlock_t*);
336     int pthread_spin_init(pthread_spinlock_t*, int);
337     int pthread_spin_lock(pthread_spinlock_t*);
338     int pthread_spin_trylock(pthread_spinlock_t*);
339     int pthread_spin_unlock(pthread_spinlock_t*);
340 }
341
342 //
343 // XOpen (XSI)
344 //
345 /*
346 PTHREAD_MUTEX_DEFAULT
347 PTHREAD_MUTEX_ERRORCHECK
348 PTHREAD_MUTEX_NORMAL
349 PTHREAD_MUTEX_RECURSIVE
350
351 int pthread_attr_getguardsize(in pthread_attr_t*, size_t*);
352 int pthread_attr_setguardsize(pthread_attr_t*, size_t);
353 int pthread_getconcurrency();
354 int pthread_mutexattr_gettype(in pthread_mutexattr_t*, int*);
355 int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
356 int pthread_setconcurrency(int);
357 */
358
359 version( linux )
360 {
361     const PTHREAD_MUTEX_NORMAL      = 0;
362     const PTHREAD_MUTEX_RECURSIVE   = 1;
363     const PTHREAD_MUTEX_ERRORCHECK  = 2;
364     const PTHREAD_MUTEX_DEFAULT     = PTHREAD_MUTEX_NORMAL;
365
366     int pthread_attr_getguardsize(in pthread_attr_t*, size_t*);
367     int pthread_attr_setguardsize(pthread_attr_t*, size_t);
368     int pthread_getconcurrency();
369     int pthread_mutexattr_gettype(in pthread_mutexattr_t*, int*);
370     int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
371     int pthread_setconcurrency(int);
372 }
373 else version( darwin )
374 {
375     const PTHREAD_MUTEX_NORMAL      = 0;
376     const PTHREAD_MUTEX_ERRORCHECK  = 1;
377     const PTHREAD_MUTEX_RECURSIVE   = 2;
378     const PTHREAD_MUTEX_DEFAULT     = PTHREAD_MUTEX_NORMAL;
379
380     int pthread_attr_getguardsize(in pthread_attr_t*, size_t*);
381     int pthread_attr_setguardsize(pthread_attr_t*, size_t);
382     int pthread_getconcurrency();
383     int pthread_mutexattr_gettype(in pthread_mutexattr_t*, int*);
384     int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
385     int pthread_setconcurrency(int);
386 }
387 else version( freebsd )
388 {
389     enum
390     {
391         PTHREAD_MUTEX_ERRORCHECK    = 1,
392         PTHREAD_MUTEX_RECURSIVE     = 2,
393         PTHREAD_MUTEX_NORMAL        = 3,
394         PTHREAD_MUTEX_ADAPTIVE_NP   = 4,
395         PTHREAD_MUTEX_TYPE_MAX
396     }
397     const PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_ERRORCHECK;
398
399     int pthread_attr_getguardsize(in pthread_attr_t*, size_t*);
400     int pthread_attr_setguardsize(pthread_attr_t*, size_t);
401     int pthread_getconcurrency();
402     int pthread_mutexattr_gettype(pthread_mutexattr_t*, int*);
403     int pthread_mutexattr_settype(pthread_mutexattr_t*, int);
404     int pthread_setconcurrency(int);
405 }
406
407 //
408 // CPU Time (TCT)
409 //
410 /*
411 int pthread_getcpuclockid(pthread_t, clockid_t*);
412 */
413
414 version( linux )
415 {
416     int pthread_getcpuclockid(pthread_t, clockid_t*);
417 }
418
419 //
420 // Timeouts (TMO)
421 //
422 /*
423 int pthread_mutex_timedlock(pthread_mutex_t*, timespec*);
424 int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*);
425 int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*);
426 */
427
428 version( linux )
429 {
430     int pthread_mutex_timedlock(pthread_mutex_t*, timespec*);
431     int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*);
432     int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*);
433 }
434 else version( darwin )
435 {
436     int pthread_mutex_timedlock(pthread_mutex_t*, timespec*);
437     int pthread_rwlock_timedrdlock(pthread_rwlock_t*, in timespec*);
438     int pthread_rwlock_timedwrlock(pthread_rwlock_t*, in timespec*);
439 }
440
441 //
442 // Priority (TPI|TPP)
443 //
444 /*
445 PTHREAD_PRIO_INHERIT (TPI)
446 PTHREAD_PRIO_NONE (TPP|TPI)
447 PTHREAD_PRIO_PROTECT (TPI)
448
449 int pthread_mutex_getprioceiling(in pthread_mutex_t*, int*); (TPP)
450 int pthread_mutex_setprioceiling(pthread_mutex_t*, int, int*); (TPP)
451 int pthread_mutexattr_getprioceiling(pthread_mutexattr_t*, int*); (TPP)
452 int pthread_mutexattr_getprotocol(in pthread_mutexattr_t*, int*); (TPI|TPP)
453 int pthread_mutexattr_setprioceiling(pthread_mutexattr_t*, int); (TPP)
454 int pthread_mutexattr_setprotocol(pthread_mutexattr_t*, int); (TPI|TPP)
455 */
456
457 //
458 // Scheduling (TPS)
459 //
460 /*
461 PTHREAD_SCOPE_PROCESS
462 PTHREAD_SCOPE_SYSTEM
463
464 int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
465 int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
466 int pthread_attr_getscope(in pthread_attr_t*, int*);
467 int pthread_attr_setinheritsched(pthread_attr_t*, int);
468 int pthread_attr_setschedpolicy(pthread_attr_t*, int);
469 int pthread_attr_setscope(pthread_attr_t*, int);
470 int pthread_getschedparam(pthread_t, int*, sched_param*);
471 int pthread_setschedparam(pthread_t, int, in sched_param*);
472 int pthread_setschedprio(pthread_t, int);
473 */
474
475 version( linux )
476 {
477     enum
478     {
479         PTHREAD_SCOPE_SYSTEM,
480         PTHREAD_SCOPE_PROCESS
481     }
482
483     int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
484     int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
485     int pthread_attr_getscope(in pthread_attr_t*, int*);
486     int pthread_attr_setinheritsched(pthread_attr_t*, int);
487     int pthread_attr_setschedpolicy(pthread_attr_t*, int);
488     int pthread_attr_setscope(pthread_attr_t*, int);
489     int pthread_getschedparam(pthread_t, int*, sched_param*);
490     int pthread_setschedparam(pthread_t, int, in sched_param*);
491     //int pthread_setschedprio(pthread_t, int);
492 }
493 else version( darwin )
494 {
495     enum
496     {
497         PTHREAD_SCOPE_SYSTEM    = 1,
498         PTHREAD_SCOPE_PROCESS   = 2
499     }
500
501     int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
502     int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
503     int pthread_attr_getscope(in pthread_attr_t*, int*);
504     int pthread_attr_setinheritsched(pthread_attr_t*, int);
505     int pthread_attr_setschedpolicy(pthread_attr_t*, int);
506     int pthread_attr_setscope(pthread_attr_t*, int);
507     int pthread_getschedparam(pthread_t, int*, sched_param*);
508     int pthread_setschedparam(pthread_t, int, in sched_param*);
509     //int pthread_setschedprio(pthread_t, int);
510 }
511 else version( freebsd )
512 {
513     enum
514     {
515         PTHREAD_SCOPE_PROCESS   = 0,
516         PTHREAD_SCOPE_SYSTEM    = 0x2
517     }
518
519     int pthread_attr_getinheritsched(in pthread_attr_t*, int*);
520     int pthread_attr_getschedpolicy(in pthread_attr_t*, int*);
521     int pthread_attr_getscope(in pthread_attr_t*, int*);
522     int pthread_attr_setinheritsched(pthread_attr_t*, int);
523     int pthread_attr_setschedpolicy(pthread_attr_t*, int);
524     int pthread_attr_setscope(in pthread_attr_t*, int);
525     int pthread_getschedparam(pthread_t, int*, sched_param*);
526     int pthread_setschedparam(pthread_t, int, sched_param*);
527     //int pthread_setschedprio(pthread_t, int);
528 }
529
530 //
531 // Stack (TSA|TSS)
532 //
533 /*
534 int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*); (TSA|TSS)
535 int pthread_attr_getstackaddr(in pthread_attr_t*, void**); (TSA)
536 int pthread_attr_getstacksize(in pthread_attr_t*, size_t*); (TSS)
537 int pthread_attr_setstack(pthread_attr_t*, void*, size_t); (TSA|TSS)
538 int pthread_attr_setstackaddr(pthread_attr_t*, void*); (TSA)
539 int pthread_attr_setstacksize(pthread_attr_t*, size_t); (TSS)
540 */
541
542 version( linux )
543 {
544     int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*);
545     int pthread_attr_getstackaddr(in pthread_attr_t*, void**);
546     int pthread_attr_getstacksize(in pthread_attr_t*, size_t*);
547     int pthread_attr_setstack(pthread_attr_t*, void*, size_t);
548     int pthread_attr_setstackaddr(pthread_attr_t*, void*);
549     int pthread_attr_setstacksize(pthread_attr_t*, size_t);
550 }
551 else version( darwin )
552 {
553     int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*);
554     int pthread_attr_getstackaddr(in pthread_attr_t*, void**);
555     int pthread_attr_getstacksize(in pthread_attr_t*, size_t*);
556     int pthread_attr_setstack(pthread_attr_t*, void*, size_t);
557     int pthread_attr_setstackaddr(pthread_attr_t*, void*);
558     int pthread_attr_setstacksize(pthread_attr_t*, size_t);
559 }
560 else version( freebsd )
561 {
562     int pthread_attr_getstack(in pthread_attr_t*, void**, size_t*);
563     int pthread_attr_getstackaddr(in pthread_attr_t*, void**);
564     int pthread_attr_getstacksize(in pthread_attr_t*, size_t*);
565     int pthread_attr_setstack(pthread_attr_t*, void*, size_t);
566     int pthread_attr_setstackaddr(pthread_attr_t*, void*);
567     int pthread_attr_setstacksize(pthread_attr_t*, size_t);
568 }
569
570 //
571 // Shared Synchronization (TSH)
572 //
573 /*
574 int pthread_condattr_getpshared(in pthread_condattr_t*, int*);
575 int pthread_condattr_setpshared(pthread_condattr_t*, int);
576 int pthread_mutexattr_getpshared(in pthread_mutexattr_t*, int*);
577 int pthread_mutexattr_setpshared(pthread_mutexattr_t*, int);
578 int pthread_rwlockattr_getpshared(in pthread_rwlockattr_t*, int*);
579 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t*, int);
580 */