-#define DISPATCH_INTROSPECTION_QUEUE_LIST \
- TAILQ_ENTRY(dispatch_queue_s) diq_list
-#define DISPATCH_INTROSPECTION_QUEUE_LIST_SIZE \
- sizeof(TAILQ_ENTRY(dispatch_queue_s))
+#define DISPATCH_INTROSPECTION_QUEUE_HEADER \
+ TAILQ_ENTRY(dispatch_queue_s) diq_list; \
+ dispatch_unfair_lock_s diq_order_top_head_lock; \
+ dispatch_unfair_lock_s diq_order_bottom_head_lock; \
+ TAILQ_HEAD(, dispatch_queue_order_entry_s) diq_order_top_head; \
+ TAILQ_HEAD(, dispatch_queue_order_entry_s) diq_order_bottom_head
+#define DISPATCH_INTROSPECTION_QUEUE_HEADER_SIZE \
+ sizeof(struct { DISPATCH_INTROSPECTION_QUEUE_HEADER; })
+
+struct dispatch_introspection_state_s {
+ TAILQ_HEAD(, dispatch_introspection_thread_s) threads;
+ TAILQ_HEAD(, dispatch_queue_s) queues;
+ dispatch_unfair_lock_s threads_lock;
+ dispatch_unfair_lock_s queues_lock;
+
+ ptrdiff_t thread_queue_offset;
+
+ // dispatch introspection features
+ bool debug_queue_inversions; // DISPATCH_DEBUG_QUEUE_INVERSIONS
+};
+
+extern struct dispatch_introspection_state_s _dispatch_introspection;