X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/a0619f9c1b0bf5530b0accb349cdfa98fa5b8c02..c6e5f90c4dd303939f631da331df7b356da942e6:/pthread/pthread.h diff --git a/pthread/pthread.h b/pthread/pthread.h index 0e2ecb7..a042c82 100644 --- a/pthread/pthread.h +++ b/pthread/pthread.h @@ -171,6 +171,12 @@ __BEGIN_DECLS #define PTHREAD_MUTEX_RECURSIVE 2 #define PTHREAD_MUTEX_DEFAULT PTHREAD_MUTEX_NORMAL +/* + * Mutex policy attributes + */ +#define PTHREAD_MUTEX_POLICY_FAIRSHARE_NP 1 +#define PTHREAD_MUTEX_POLICY_FIRSTFIT_NP 3 + /* * RWLock variables */ @@ -182,7 +188,7 @@ __BEGIN_DECLS #define PTHREAD_MUTEX_INITIALIZER {_PTHREAD_MUTEX_SIG_init, {0}} /* */ -#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)) +#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)) || defined(__DRIVERKIT_VERSION_MIN_REQUIRED) # if (!defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)) || defined(_DARWIN_C_SOURCE) # define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER {_PTHREAD_ERRORCHECK_MUTEX_SIG_init, {0}} # define PTHREAD_RECURSIVE_MUTEX_INITIALIZER {_PTHREAD_RECURSIVE_MUTEX_SIG_init, {0}} @@ -405,6 +411,10 @@ __API_AVAILABLE(macos(10.4), ios(2.0)) int pthread_mutexattr_gettype(const pthread_mutexattr_t * __restrict, int * __restrict); +__API_AVAILABLE(macos(10.13.4), ios(11.3), watchos(4.3), tvos(11.3)) +int pthread_mutexattr_getpolicy_np(const pthread_mutexattr_t * __restrict, + int * __restrict); + __API_AVAILABLE(macos(10.4), ios(2.0)) int pthread_mutexattr_init(pthread_mutexattr_t *); @@ -420,6 +430,9 @@ int pthread_mutexattr_setpshared(pthread_mutexattr_t *, int); __API_AVAILABLE(macos(10.4), ios(2.0)) int pthread_mutexattr_settype(pthread_mutexattr_t *, int); +__API_AVAILABLE(macos(10.7), ios(5.0)) +int pthread_mutexattr_setpolicy_np(pthread_mutexattr_t *, int); + __SWIFT_UNAVAILABLE_MSG("Use lazily initialized globals instead") __API_AVAILABLE(macos(10.4), ios(2.0)) int pthread_once(pthread_once_t *, void (* _Nonnull)(void));