-#define TH_LIST_INITED 0x01 /* Set at thread creation. */
-#define TH_LIST_RUNNING 0x02 /* On thrunlist, not parked. */
-#define TH_LIST_KEVENT 0x04 /* Thread requested by kevent */
-#define TH_LIST_NEW 0x08 /* First return to userspace */
-#define TH_LIST_BUSY 0x10 /* Removed from idle list but not ready yet. */
-#define TH_LIST_KEVENT_BOUND 0x20 /* Thread bound to kqueues */
-#define TH_LIST_CONSTRAINED 0x40 /* Non-overcommit thread. */
-#define TH_LIST_EVENT_MGR_SCHED_PRI 0x80 /* Non-QoS Event Manager */
+#define TH_LIST_INITED 0x0001 /* Set at thread creation. */
+#define TH_LIST_RUNNING 0x0002 /* On thrunlist, not parked. */
+#define TH_LIST_KEVENT 0x0004 /* Thread requested by kevent */
+#define TH_LIST_NEW 0x0008 /* First return to userspace */
+#define TH_LIST_BUSY 0x0010 /* Removed from idle list but not ready yet. */
+#define TH_LIST_KEVENT_BOUND 0x0020 /* Thread bound to kqueues */
+#define TH_LIST_CONSTRAINED 0x0040 /* Non-overcommit thread. */
+#define TH_LIST_EVENT_MGR_SCHED_PRI 0x0080 /* Non-QoS Event Manager */
+#define TH_LIST_UNBINDING 0x0100 /* Thread is unbinding during park */
+#define TH_LIST_REMOVING_VOUCHER 0x0200 /* Thread is removing its voucher */
+#define TH_LIST_PACING 0x0400 /* Thread is participating in pacing */
+
+struct threadreq {
+ TAILQ_ENTRY(threadreq) tr_entry;
+ uint16_t tr_flags;
+ uint8_t tr_state;
+ uint8_t tr_priority;
+};
+TAILQ_HEAD(threadreq_head, threadreq);
+
+#define TR_STATE_NEW 0 /* Not yet enqueued */
+#define TR_STATE_WAITING 1 /* Waiting to be serviced - on reqlist */
+#define TR_STATE_COMPLETE 2 /* Request handled - for caller to free */
+#define TR_STATE_DEAD 3
+
+#define TR_FLAG_KEVENT 0x01
+#define TR_FLAG_OVERCOMMIT 0x02
+#define TR_FLAG_ONSTACK 0x04
+#define TR_FLAG_WORKLOOP 0x08
+#define TR_FLAG_NO_PACING 0x10
+
+#if defined(__LP64__)
+typedef unsigned __int128 wq_thactive_t;
+#else
+typedef uint64_t wq_thactive_t;
+#endif