1 /**
2  * D header file for Darwin.
3  *
4  * Copyright: Copyright Sean Kelly 2008 - 2009.
5  * License:   $(HTTP www.boost.org/LICENSE_1_0.txt, Boost License 1.0).
6  * Authors:   Sean Kelly
7  */
8 
9 /*          Copyright Sean Kelly 2008 - 2009.
10  * Distributed under the Boost Software License, Version 1.0.
11  *    (See accompanying file LICENSE or copy at
12  *          http://www.boost.org/LICENSE_1_0.txt)
13  */
14 module core.sys.darwin.pthread;
15 
16 version (OSX)
17     version = Darwin;
18 else version (iOS)
19     version = Darwin;
20 else version (TVOS)
21     version = Darwin;
22 else version (WatchOS)
23     version = Darwin;
24 
25 version (Darwin):
26 extern (C):
27 nothrow:
28 @nogc:
29 
30 public import core.sys.posix.pthread;
31 public import core.sys.darwin.mach.port;
32 
33 int pthread_is_threaded_np();
34 int pthread_threadid_np(pthread_t, ulong*);
35 // ^ __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2)
36 int pthread_rwlock_longrdlock_np(pthread_rwlock_t*);
37 int pthread_rwlock_yieldwrlock_np(pthread_rwlock_t*);
38 // ^ __OSX_AVAILABLE_STARTING(__MAC_10_7, __IPHONE_NA);
39 int pthread_rwlock_downgrade_np(pthread_rwlock_t*);
40 int pthread_rwlock_upgrade_np(pthread_rwlock_t*);
41 int pthread_rwlock_tryupgrade_np(pthread_rwlock_t*);
42 int pthread_rwlock_held_np(pthread_rwlock_t*);
43 int pthread_rwlock_rdheld_np(pthread_rwlock_t*);
44 int pthread_rwlock_wrheld_np(pthread_rwlock_t*);
45 int pthread_getname_np(pthread_t, char*, size_t);
46 int pthread_setname_np(const scope char*);
47 // ^ __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2)
48 int pthread_main_np();
49 mach_port_t pthread_mach_thread_np(pthread_t);
50 size_t pthread_get_stacksize_np(pthread_t);
51 void* pthread_get_stackaddr_np(pthread_t);
52 int pthread_cond_signal_thread_np(pthread_cond_t*, pthread_t);
53 int pthread_cond_timedwait_relative_np(pthread_cond_t*, pthread_mutex_t*, const scope timespec*);
54 int pthread_create_suspended_np(pthread_t*, const scope pthread_attr_t*, void* function(void*), void*);
55 int pthread_kill(pthread_t, int);
56 pthread_t pthread_from_mach_thread_np(mach_port_t);
57 // ^ __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0)
58 int pthread_sigmask(int, const scope sigset_t*, sigset_t*);
59 // ^ __DARWIN_ALIAS(pthread_sigmask)
60 void pthread_yield_np();