2 * Copyright (c) 2000-2012 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
24 * Copyright 1996 1995 by Open Software Foundation, Inc. 1997 1996 1995 1994 1993 1992 1991
27 * Permission to use, copy, modify, and distribute this software and
28 * its documentation for any purpose and without fee is hereby granted,
29 * provided that the above copyright notice appears in all copies and
30 * that both the copyright notice and this permission notice appear in
31 * supporting documentation.
33 * OSF DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
34 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
35 * FOR A PARTICULAR PURPOSE.
37 * IN NO EVENT SHALL OSF BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
38 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
39 * LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
40 * NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
41 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
49 * POSIX Threads - IEEE 1003.1c
57 #include <pthread/pthread_impl.h>
59 #include <pthread/sched.h>
61 #include <sys/_pthread/_pthread_types.h>
62 #include <sys/_pthread/_pthread_attr_t.h>
63 #include <sys/_pthread/_pthread_cond_t.h>
64 #include <sys/_pthread/_pthread_condattr_t.h>
65 #include <sys/_pthread/_pthread_key_t.h>
66 #include <sys/_pthread/_pthread_mutex_t.h>
67 #include <sys/_pthread/_pthread_mutexattr_t.h>
68 #include <sys/_pthread/_pthread_once_t.h>
69 #include <sys/_pthread/_pthread_rwlock_t.h>
70 #include <sys/_pthread/_pthread_rwlockattr_t.h>
71 #include <sys/_pthread/_pthread_t.h>
73 #include <pthread/qos.h>
75 #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(__cplusplus)
77 #include <sys/_types/_mach_port_t.h>
78 #include <sys/_types/_sigset_t.h>
80 #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */
83 * These symbols indicate which [optional] features are available
84 * They can be tested at compile time via '#ifdef XXX'
85 * The way to check for pthreads is like so:
88 * #ifdef _POSIX_THREADS
89 * #include <pthread.h>
94 /* These will be moved to unistd.h */
97 * Note: These data structures are meant to be opaque. Only enough
98 * structure is exposed to support initializers.
99 * All of the typedefs will be moved to <sys/types.h>
102 #include <sys/cdefs.h>
103 #include <Availability.h>
105 #if __has_feature(assume_nonnull)
106 _Pragma("clang assume_nonnull begin")
115 * Cancel cleanup handler management. Note, since these are implemented as macros,
116 * they *MUST* occur in matched pairs!
119 #define pthread_cleanup_push(func, val) \
121 struct __darwin_pthread_handler_rec __handler; \
122 pthread_t __self = pthread_self(); \
123 __handler.__routine = func; \
124 __handler.__arg = val; \
125 __handler.__next = __self->__cleanup_stack; \
126 __self->__cleanup_stack = &__handler;
128 #define pthread_cleanup_pop(execute) \
129 /* Note: 'handler' must be in this same lexical context! */ \
130 __self->__cleanup_stack = __handler.__next; \
131 if (execute) (__handler.__routine)(__handler.__arg); \
138 #define PTHREAD_CREATE_JOINABLE 1
139 #define PTHREAD_CREATE_DETACHED 2
141 #define PTHREAD_INHERIT_SCHED 1
142 #define PTHREAD_EXPLICIT_SCHED 2
144 #define PTHREAD_CANCEL_ENABLE 0x01 /* Cancel takes place at next cancellation point */
145 #define PTHREAD_CANCEL_DISABLE 0x00 /* Cancel postponed */
146 #define PTHREAD_CANCEL_DEFERRED 0x02 /* Cancel waits until cancellation point */
147 #define PTHREAD_CANCEL_ASYNCHRONOUS 0x00 /* Cancel occurs immediately */
149 /* Value returned from pthread_join() when a thread is canceled */
150 #define PTHREAD_CANCELED ((void *) 1)
152 /* We only support PTHREAD_SCOPE_SYSTEM */
153 #define PTHREAD_SCOPE_SYSTEM 1
154 #define PTHREAD_SCOPE_PROCESS 2
156 #define PTHREAD_PROCESS_SHARED 1
157 #define PTHREAD_PROCESS_PRIVATE 2
160 * Mutex protocol attributes
162 #define PTHREAD_PRIO_NONE 0
163 #define PTHREAD_PRIO_INHERIT 1
164 #define PTHREAD_PRIO_PROTECT 2
167 * Mutex type attributes
169 #define PTHREAD_MUTEX_NORMAL 0
170 #define PTHREAD_MUTEX_ERRORCHECK 1
171 #define PTHREAD_MUTEX_RECURSIVE 2
172 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL
177 #define PTHREAD_RWLOCK_INITIALIZER {_PTHREAD_RWLOCK_SIG_init, {0}}
182 #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}}
184 /* <rdar://problem/10854763> */
185 #if ((__MAC_OS_X_VERSION_MIN_REQUIRED && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070) || (__IPHONE_OS_VERSION_MIN_REQUIRED && __IPHONE_OS_VERSION_MIN_REQUIRED >= 50000))
186 # if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE)
187 # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {_PTHREAD_ERRORCHECK_MUTEX_SIG_init, {0}}
188 # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {_PTHREAD_RECURSIVE_MUTEX_SIG_init, {0}}
189 # endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE */
192 /* <rdar://problem/25944576> */
193 #define _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT \
194 defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))
197 * Condition variable attributes
201 * Condition variables
204 #define PTHREAD_COND_INITIALIZER {_PTHREAD_COND_SIG_init, {0}}
207 * Initialization control (once) variables
210 #define PTHREAD_ONCE_INIT {_PTHREAD_ONCE_SIG_init, {0}}
213 * Prototypes for all PTHREAD interfaces
215 __API_AVAILABLE(macos(10.4), ios(2.0))
216 int pthread_atfork(void (* _Nullable
)(void), void (* _Nullable
)(void),
217 void (* _Nullable
)(void));
219 __API_AVAILABLE(macos(10.4), ios(2.0))
220 int pthread_attr_destroy(pthread_attr_t
*);
222 __API_AVAILABLE(macos(10.4), ios(2.0))
223 int pthread_attr_getdetachstate(const pthread_attr_t
*, int *);
225 __API_AVAILABLE(macos(10.4), ios(2.0))
226 int pthread_attr_getguardsize(const pthread_attr_t
* __restrict
, size_t * __restrict
);
228 __API_AVAILABLE(macos(10.4), ios(2.0))
229 int pthread_attr_getinheritsched(const pthread_attr_t
* __restrict
, int * __restrict
);
231 __API_AVAILABLE(macos(10.4), ios(2.0))
232 int pthread_attr_getschedparam(const pthread_attr_t
* __restrict
,
233 struct sched_param
* __restrict
);
235 __API_AVAILABLE(macos(10.4), ios(2.0))
236 int pthread_attr_getschedpolicy(const pthread_attr_t
* __restrict
, int * __restrict
);
238 __API_AVAILABLE(macos(10.4), ios(2.0))
239 int pthread_attr_getscope(const pthread_attr_t
* __restrict
, int * __restrict
);
241 __API_AVAILABLE(macos(10.4), ios(2.0))
242 int pthread_attr_getstack(const pthread_attr_t
* __restrict
,
243 void * _Nullable
* _Nonnull __restrict
, size_t * __restrict
);
245 __API_AVAILABLE(macos(10.4), ios(2.0))
246 int pthread_attr_getstackaddr(const pthread_attr_t
* __restrict
,
247 void * _Nullable
* _Nonnull __restrict
);
249 __API_AVAILABLE(macos(10.4), ios(2.0))
250 int pthread_attr_getstacksize(const pthread_attr_t
* __restrict
, size_t * __restrict
);
252 __API_AVAILABLE(macos(10.4), ios(2.0))
253 int pthread_attr_init(pthread_attr_t
*);
255 __API_AVAILABLE(macos(10.4), ios(2.0))
256 int pthread_attr_setdetachstate(pthread_attr_t
*, int);
258 __API_AVAILABLE(macos(10.4), ios(2.0))
259 int pthread_attr_setguardsize(pthread_attr_t
*, size_t);
261 __API_AVAILABLE(macos(10.4), ios(2.0))
262 int pthread_attr_setinheritsched(pthread_attr_t
*, int);
264 __API_AVAILABLE(macos(10.4), ios(2.0))
265 int pthread_attr_setschedparam(pthread_attr_t
* __restrict
,
266 const struct sched_param
* __restrict
);
268 __API_AVAILABLE(macos(10.4), ios(2.0))
269 int pthread_attr_setschedpolicy(pthread_attr_t
*, int);
271 __API_AVAILABLE(macos(10.4), ios(2.0))
272 int pthread_attr_setscope(pthread_attr_t
*, int);
274 __API_AVAILABLE(macos(10.4), ios(2.0))
275 int pthread_attr_setstack(pthread_attr_t
*, void *, size_t);
277 __API_AVAILABLE(macos(10.4), ios(2.0))
278 int pthread_attr_setstackaddr(pthread_attr_t
*, void *);
280 __API_AVAILABLE(macos(10.4), ios(2.0))
281 int pthread_attr_setstacksize(pthread_attr_t
*, size_t);
283 __API_AVAILABLE(macos(10.4), ios(2.0))
284 int pthread_cancel(pthread_t
) __DARWIN_ALIAS(pthread_cancel
);
286 __API_AVAILABLE(macos(10.4), ios(2.0))
287 int pthread_cond_broadcast(pthread_cond_t
*);
289 __API_AVAILABLE(macos(10.4), ios(2.0))
290 int pthread_cond_destroy(pthread_cond_t
*);
292 __API_AVAILABLE(macos(10.4), ios(2.0))
293 int pthread_cond_init(
294 pthread_cond_t
* __restrict
,
295 const pthread_condattr_t
* _Nullable __restrict
)
296 __DARWIN_ALIAS(pthread_cond_init
);
298 __API_AVAILABLE(macos(10.4), ios(2.0))
299 int pthread_cond_signal(pthread_cond_t
*);
301 __API_AVAILABLE(macos(10.4), ios(2.0))
302 int pthread_cond_timedwait(
303 pthread_cond_t
* __restrict
, pthread_mutex_t
* __restrict
,
304 const struct timespec
* _Nullable __restrict
)
305 __DARWIN_ALIAS_C(pthread_cond_timedwait
);
307 __API_AVAILABLE(macos(10.4), ios(2.0))
308 int pthread_cond_wait(pthread_cond_t
* __restrict
,
309 pthread_mutex_t
* __restrict
) __DARWIN_ALIAS_C(pthread_cond_wait
);
311 __API_AVAILABLE(macos(10.4), ios(2.0))
312 int pthread_condattr_destroy(pthread_condattr_t
*);
314 __API_AVAILABLE(macos(10.4), ios(2.0))
315 int pthread_condattr_init(pthread_condattr_t
*);
317 __API_AVAILABLE(macos(10.4), ios(2.0))
318 int pthread_condattr_getpshared(const pthread_condattr_t
* __restrict
,
321 __API_AVAILABLE(macos(10.4), ios(2.0))
322 int pthread_condattr_setpshared(pthread_condattr_t
*, int);
324 __API_AVAILABLE(macos(10.4), ios(2.0))
325 #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
326 int pthread_create(pthread_t _Nullable
* _Nonnull __restrict
,
327 const pthread_attr_t
* _Nullable __restrict
,
328 void * _Nullable (* _Nonnull
)(void * _Nullable
),
329 void * _Nullable __restrict
);
331 int pthread_create(pthread_t
* __restrict
,
332 const pthread_attr_t
* _Nullable __restrict
,
333 void *(* _Nonnull
)(void *), void * _Nullable __restrict
);
334 #endif // _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
336 __API_AVAILABLE(macos(10.4), ios(2.0))
337 int pthread_detach(pthread_t
);
339 __API_AVAILABLE(macos(10.4), ios(2.0))
340 int pthread_equal(pthread_t _Nullable
, pthread_t _Nullable
);
342 __API_AVAILABLE(macos(10.4), ios(2.0))
343 void pthread_exit(void * _Nullable
) __dead2
;
345 __API_AVAILABLE(macos(10.4), ios(2.0))
346 int pthread_getconcurrency(void);
348 __API_AVAILABLE(macos(10.4), ios(2.0))
349 int pthread_getschedparam(pthread_t
, int * _Nullable __restrict
,
350 struct sched_param
* _Nullable __restrict
);
352 __API_AVAILABLE(macos(10.4), ios(2.0))
353 void* _Nullable
pthread_getspecific(pthread_key_t
);
355 __API_AVAILABLE(macos(10.4), ios(2.0))
356 int pthread_join(pthread_t
, void * _Nullable
* _Nullable
)
357 __DARWIN_ALIAS_C(pthread_join
);
359 __API_AVAILABLE(macos(10.4), ios(2.0))
360 int pthread_key_create(pthread_key_t
*, void (* _Nullable
)(void *));
362 __API_AVAILABLE(macos(10.4), ios(2.0))
363 int pthread_key_delete(pthread_key_t
);
365 __API_AVAILABLE(macos(10.4), ios(2.0))
366 int pthread_mutex_destroy(pthread_mutex_t
*);
368 __API_AVAILABLE(macos(10.4), ios(2.0))
369 int pthread_mutex_getprioceiling(const pthread_mutex_t
* __restrict
,
372 __API_AVAILABLE(macos(10.4), ios(2.0))
373 int pthread_mutex_init(pthread_mutex_t
* __restrict
,
374 const pthread_mutexattr_t
* _Nullable __restrict
);
376 __API_AVAILABLE(macos(10.4), ios(2.0))
377 int pthread_mutex_lock(pthread_mutex_t
*);
379 __API_AVAILABLE(macos(10.4), ios(2.0))
380 int pthread_mutex_setprioceiling(pthread_mutex_t
* __restrict
, int,
383 __API_AVAILABLE(macos(10.4), ios(2.0))
384 int pthread_mutex_trylock(pthread_mutex_t
*);
386 __API_AVAILABLE(macos(10.4), ios(2.0))
387 int pthread_mutex_unlock(pthread_mutex_t
*);
389 __API_AVAILABLE(macos(10.4), ios(2.0))
390 int pthread_mutexattr_destroy(pthread_mutexattr_t
*) __DARWIN_ALIAS(pthread_mutexattr_destroy
);
392 __API_AVAILABLE(macos(10.4), ios(2.0))
393 int pthread_mutexattr_getprioceiling(const pthread_mutexattr_t
* __restrict
,
396 __API_AVAILABLE(macos(10.4), ios(2.0))
397 int pthread_mutexattr_getprotocol(const pthread_mutexattr_t
* __restrict
,
400 __API_AVAILABLE(macos(10.4), ios(2.0))
401 int pthread_mutexattr_getpshared(const pthread_mutexattr_t
* __restrict
,
404 __API_AVAILABLE(macos(10.4), ios(2.0))
405 int pthread_mutexattr_gettype(const pthread_mutexattr_t
* __restrict
,
408 __API_AVAILABLE(macos(10.4), ios(2.0))
409 int pthread_mutexattr_init(pthread_mutexattr_t
*);
411 __API_AVAILABLE(macos(10.4), ios(2.0))
412 int pthread_mutexattr_setprioceiling(pthread_mutexattr_t
*, int);
414 __API_AVAILABLE(macos(10.4), ios(2.0))
415 int pthread_mutexattr_setprotocol(pthread_mutexattr_t
*, int);
417 __API_AVAILABLE(macos(10.4), ios(2.0))
418 int pthread_mutexattr_setpshared(pthread_mutexattr_t
*, int);
420 __API_AVAILABLE(macos(10.4), ios(2.0))
421 int pthread_mutexattr_settype(pthread_mutexattr_t
*, int);
423 __SWIFT_UNAVAILABLE_MSG("Use lazily initialized globals instead")
424 __API_AVAILABLE(macos(10.4), ios(2.0))
425 int pthread_once(pthread_once_t
*, void (* _Nonnull
)(void));
427 __API_AVAILABLE(macos(10.4), ios(2.0))
428 int pthread_rwlock_destroy(pthread_rwlock_t
* ) __DARWIN_ALIAS(pthread_rwlock_destroy
);
430 __API_AVAILABLE(macos(10.4), ios(2.0))
431 int pthread_rwlock_init(pthread_rwlock_t
* __restrict
,
432 const pthread_rwlockattr_t
* _Nullable __restrict
)
433 __DARWIN_ALIAS(pthread_rwlock_init
);
435 __API_AVAILABLE(macos(10.4), ios(2.0))
436 int pthread_rwlock_rdlock(pthread_rwlock_t
*) __DARWIN_ALIAS(pthread_rwlock_rdlock
);
438 __API_AVAILABLE(macos(10.4), ios(2.0))
439 int pthread_rwlock_tryrdlock(pthread_rwlock_t
*) __DARWIN_ALIAS(pthread_rwlock_tryrdlock
);
441 __API_AVAILABLE(macos(10.4), ios(2.0))
442 int pthread_rwlock_trywrlock(pthread_rwlock_t
*) __DARWIN_ALIAS(pthread_rwlock_trywrlock
);
444 __API_AVAILABLE(macos(10.4), ios(2.0))
445 int pthread_rwlock_wrlock(pthread_rwlock_t
*) __DARWIN_ALIAS(pthread_rwlock_wrlock
);
447 __API_AVAILABLE(macos(10.4), ios(2.0))
448 int pthread_rwlock_unlock(pthread_rwlock_t
*) __DARWIN_ALIAS(pthread_rwlock_unlock
);
450 __API_AVAILABLE(macos(10.4), ios(2.0))
451 int pthread_rwlockattr_destroy(pthread_rwlockattr_t
*);
453 __API_AVAILABLE(macos(10.4), ios(2.0))
454 int pthread_rwlockattr_getpshared(const pthread_rwlockattr_t
* __restrict
,
457 __API_AVAILABLE(macos(10.4), ios(2.0))
458 int pthread_rwlockattr_init(pthread_rwlockattr_t
*);
460 __API_AVAILABLE(macos(10.4), ios(2.0))
461 int pthread_rwlockattr_setpshared(pthread_rwlockattr_t
*, int);
463 __API_AVAILABLE(macos(10.4), ios(2.0))
464 pthread_t
pthread_self(void);
466 __API_AVAILABLE(macos(10.4), ios(2.0))
467 int pthread_setcancelstate(int , int * _Nullable
)
468 __DARWIN_ALIAS(pthread_setcancelstate
);
470 __API_AVAILABLE(macos(10.4), ios(2.0))
471 int pthread_setcanceltype(int , int * _Nullable
)
472 __DARWIN_ALIAS(pthread_setcanceltype
);
474 __API_AVAILABLE(macos(10.4), ios(2.0))
475 int pthread_setconcurrency(int);
477 __API_AVAILABLE(macos(10.4), ios(2.0))
478 int pthread_setschedparam(pthread_t
, int, const struct sched_param
*);
480 __API_AVAILABLE(macos(10.4), ios(2.0))
481 int pthread_setspecific(pthread_key_t
, const void * _Nullable
);
483 __API_AVAILABLE(macos(10.4), ios(2.0))
484 void pthread_testcancel(void) __DARWIN_ALIAS(pthread_testcancel
);
486 #if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) || defined(__cplusplus)
488 /* returns non-zero if pthread_create or cthread_fork have been called */
489 __API_AVAILABLE(macos(10.4), ios(2.0))
490 int pthread_is_threaded_np(void);
492 __API_AVAILABLE(macos(10.6), ios(3.2))
493 int pthread_threadid_np(pthread_t _Nullable
,__uint64_t
* _Nullable
);
495 /*SPI to set and get pthread name*/
496 __API_AVAILABLE(macos(10.6), ios(3.2))
497 int pthread_getname_np(pthread_t
,char*,size_t);
499 __API_AVAILABLE(macos(10.6), ios(3.2))
500 int pthread_setname_np(const char*);
502 /* returns non-zero if the current thread is the main thread */
503 __API_AVAILABLE(macos(10.4), ios(2.0))
504 int pthread_main_np(void);
506 /* return the mach thread bound to the pthread */
507 __API_AVAILABLE(macos(10.4), ios(2.0))
508 mach_port_t
pthread_mach_thread_np(pthread_t
);
510 __API_AVAILABLE(macos(10.4), ios(2.0))
511 size_t pthread_get_stacksize_np(pthread_t
);
513 __API_AVAILABLE(macos(10.4), ios(2.0))
514 void* pthread_get_stackaddr_np(pthread_t
);
516 /* Like pthread_cond_signal(), but only wake up the specified pthread */
517 __API_AVAILABLE(macos(10.4), ios(2.0))
518 int pthread_cond_signal_thread_np(pthread_cond_t
*, pthread_t _Nullable
);
520 /* Like pthread_cond_timedwait, but use a relative timeout */
521 __API_AVAILABLE(macos(10.4), ios(2.0))
522 int pthread_cond_timedwait_relative_np(pthread_cond_t
*, pthread_mutex_t
*,
523 const struct timespec
* _Nullable
);
525 /* Like pthread_create(), but leaves the thread suspended */
526 __API_AVAILABLE(macos(10.4), ios(2.0))
527 #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
528 int pthread_create_suspended_np(
529 pthread_t _Nullable
* _Nonnull
, const pthread_attr_t
* _Nullable
,
530 void * _Nullable (* _Nonnull
)(void * _Nullable
), void * _Nullable
);
532 int pthread_create_suspended_np(pthread_t
*, const pthread_attr_t
* _Nullable
,
533 void *(* _Nonnull
)(void *), void * _Nullable
);
536 __API_AVAILABLE(macos(10.4), ios(2.0))
537 int pthread_kill(pthread_t
, int);
539 __API_AVAILABLE(macos(10.5), ios(2.0))
540 _Nullable pthread_t
pthread_from_mach_thread_np(mach_port_t
);
542 __API_AVAILABLE(macos(10.4), ios(2.0))
543 int pthread_sigmask(int, const sigset_t
* _Nullable
, sigset_t
* _Nullable
)
544 __DARWIN_ALIAS(pthread_sigmask
);
546 __API_AVAILABLE(macos(10.4), ios(2.0))
547 void pthread_yield_np(void);
549 #endif /* (!_POSIX_C_SOURCE && !_XOPEN_SOURCE) || _DARWIN_C_SOURCE || __cplusplus */
551 #if __has_feature(assume_nonnull)
552 _Pragma("clang assume_nonnull end")
555 #endif /* _PTHREAD_H */