X-Git-Url: https://git.saurik.com/apple/libpthread.git/blobdiff_plain/f1a1da6cf65a9d0e6858678f6c259025cf5d27fd..964d3577b041867f776d8eb940bf4a1108ffb97c:/private/workqueue_private.h diff --git a/private/workqueue_private.h b/private/workqueue_private.h index aaaf402..74b3a1b 100644 --- a/private/workqueue_private.h +++ b/private/workqueue_private.h @@ -25,6 +25,7 @@ #define __PTHREAD_WORKQUEUE_H__ #include +#include #include #include #include @@ -32,7 +33,7 @@ #include #endif -#define PTHREAD_WORKQUEUE_SPI_VERSION 20140730 +#define PTHREAD_WORKQUEUE_SPI_VERSION 20150304 /* Feature checking flags, returned by _pthread_workqueue_supported() * @@ -42,6 +43,7 @@ #define WORKQ_FEATURE_DISPATCHFUNC 0x01 // pthread_workqueue_setdispatch_np is supported (or not) #define WORKQ_FEATURE_FINEPRIO 0x02 // fine grained pthread workq priorities #define WORKQ_FEATURE_MAINTENANCE 0x10 // QOS class maintenance +#define WORKQ_FEATURE_KEVENT 0x20 // Support for direct kevent delivery /* Legacy dispatch priority bands */ @@ -62,6 +64,9 @@ __BEGIN_DECLS typedef void (*pthread_workqueue_function_t)(int queue_priority, int options, void *ctxt); // New callback prototype, used with pthread_workqueue_init typedef void (*pthread_workqueue_function2_t)(pthread_priority_t priority); +// Newer callback prototype, used in conjection with function2 when there are kevents to deliver +// both parameters are in/out parameters +typedef void (*pthread_workqueue_function_kevent_t)(void **events, int *nevents); // Initialises the pthread workqueue subsystem, passing the new-style callback prototype, // the dispatchoffset and an unused flags field. @@ -69,6 +74,10 @@ __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int _pthread_workqueue_init(pthread_workqueue_function2_t func, int offset, int flags); +__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) +int +_pthread_workqueue_init_with_kevent(pthread_workqueue_function2_t queue_func, pthread_workqueue_function_kevent_t kevent_func, int offset, int flags); + // Non-zero enables kill on current thread, zero disables it. __OSX_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_3_2) int @@ -99,6 +108,10 @@ __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int _pthread_workqueue_addthreads(int numthreads, pthread_priority_t priority); +__OSX_AVAILABLE_STARTING(__MAC_10_11, __IPHONE_9_0) +int +_pthread_workqueue_set_event_manager_priority(pthread_priority_t priority); + // Apply a QoS override without allocating userspace memory __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int @@ -119,6 +132,21 @@ __OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0) int _pthread_workqueue_override_reset(void); +// Apply a QoS override on a given thread (can be non-workqueue as well) with a resource/queue token +__OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_NA) +int +_pthread_workqueue_asynchronous_override_add(mach_port_t thread, pthread_priority_t priority, void *resource); + +// Reset overrides for the given resource for the current thread +__OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_NA) +int +_pthread_workqueue_asynchronous_override_reset_self(void *resource); + +// Reset overrides for all resources for the current thread +__OSX_AVAILABLE_STARTING(__MAC_10_10_2, __IPHONE_NA) +int +_pthread_workqueue_asynchronous_override_reset_all_self(void); + __END_DECLS #endif // __PTHREAD_WORKQUEUE_H__