typedef void (*pthread_workqueue_function_workloop_t)(uint64_t *workloop_id, void **events, int *nevents);
+#define PTHREAD_WORKQUEUE_CONFIG_VERSION 2
+#define PTHREAD_WORKQUEUE_CONFIG_MIN_SUPPORTED_VERSION 1
+#define PTHREAD_WORKQUEUE_CONFIG_SUPPORTED_FLAGS 0
+struct pthread_workqueue_config {
+ uint32_t flags;
+ uint32_t version;
+ pthread_workqueue_function_kevent_t kevent_cb;
+ pthread_workqueue_function_workloop_t workloop_cb;
+ pthread_workqueue_function2_t workq_cb;
+ uint64_t queue_serialno_offs;
+ uint64_t queue_label_offs;
+};
+
+__API_AVAILABLE(macos(10.15), ios(13.0))
+int
+pthread_workqueue_setup(struct pthread_workqueue_config *cfg, size_t cfg_size);
+
// Initialises the pthread workqueue subsystem, passing the new-style callback prototype,
// the dispatchoffset and an unused flags field.
__API_AVAILABLE(macos(10.10), ios(8.0))
int
_pthread_workqueue_asynchronous_override_reset_all_self(void);
+__API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
+int
+_pthread_workloop_create(uint64_t workloop_id, uint64_t options, pthread_attr_t *attr);
+
+__API_AVAILABLE(macos(10.14), ios(12.0), tvos(12.0), watchos(5.0))
+int
+_pthread_workloop_destroy(uint64_t workloop_id);
+
__END_DECLS
#endif // __PTHREAD_WORKQUEUE_H__