+ struct waitq_set *uu_wqset; /* waitq state cached across select calls */
+ size_t uu_wqstate_sz; /* ...size of uu_wqset buffer */
+ int uu_flag;
+ sigset_t uu_siglist; /* signals pending for the thread */
+ sigset_t uu_sigwait; /* sigwait on this thread*/
+ sigset_t uu_sigmask; /* signal mask for the thread */
+ sigset_t uu_oldmask; /* signal mask saved before sigpause */
+ sigset_t uu_vforkmask; /* saved signal mask during vfork */
+ struct vfs_context uu_context; /* thread + cred */
+
+ TAILQ_ENTRY(uthread) uu_list; /* List of uthreads in proc */
+
+ struct kaudit_record *uu_ar; /* audit record */
+ struct task* uu_aio_task; /* target task for async io */
+
+ lck_mtx_t *uu_mtx;
+
+ lck_spin_t uu_rethrottle_lock; /* locks was_rethrottled and is_throttled */
+ TAILQ_ENTRY(uthread) uu_throttlelist; /* List of uthreads currently throttled */
+ void * uu_throttle_info; /* pointer to throttled I/Os info */
+ int uu_on_throttlelist;
+ int uu_lowpri_window;
+ /* These boolean fields are protected by different locks */
+ bool uu_was_rethrottled;
+ bool uu_is_throttled;
+ bool uu_throttle_bc;
+
+ u_int32_t uu_network_marks; /* network control flow marks */
+
+ struct kern_sigaltstack uu_sigstk;
+ vnode_t uu_vreclaims;
+ vnode_t uu_cdir; /* per thread CWD */
+ int uu_dupfd; /* fd in fdesc_open/dupfdopen */
+ int uu_defer_reclaims;
+
+ /*
+ * Bound kqueue request. This field is only cleared by the current thread,
+ * hence can be dereferenced safely by the current thread without locks.
+ */
+ struct kqrequest *uu_kqr_bound;
+ TAILQ_ENTRY(uthread) uu_workq_entry;
+ mach_vm_offset_t uu_workq_stackaddr;
+ mach_port_name_t uu_workq_thport;
+ struct uu_workq_policy {
+ uint16_t qos_req : 4; /* requested QoS */
+ uint16_t qos_max : 4; /* current acked max qos */
+ uint16_t qos_override : 4; /* received async override */
+ uint16_t qos_bucket : 4; /* current acked bucket */
+ } uu_workq_pri;
+ uint8_t uu_workq_flags;
+ kq_index_t uu_kqueue_override;
+
+#ifdef JOE_DEBUG
+ int uu_iocount;
+ int uu_vpindex;
+ void *uu_vps[32];
+ void *uu_pcs[32][10];
+#endif
+#if CONFIG_WORKLOOP_DEBUG
+#define UU_KEVENT_HISTORY_COUNT 32
+#define UU_KEVENT_HISTORY_WRITE_ENTRY(uth, ...) ({ \
+ struct uthread *__uth = (uth); \
+ unsigned int __index = __uth->uu_kevent_index++; \
+ __uth->uu_kevent_history[__index % UU_KEVENT_HISTORY_COUNT] = \
+ (struct uu_kevent_history)__VA_ARGS__; \
+ })
+ struct uu_kevent_history {
+ uint64_t uu_kqid;
+ struct kqueue *uu_kq;
+ int uu_error, uu_nchanges, uu_nevents;
+ unsigned int uu_flags;
+ } uu_kevent_history[UU_KEVENT_HISTORY_COUNT];
+ unsigned int uu_kevent_index;
+#endif
+ int uu_proc_refcount;
+#if PROC_REF_DEBUG
+#define NUM_PROC_REFS_TO_TRACK 32
+#define PROC_REF_STACK_DEPTH 10
+ int uu_pindex;
+ void * uu_proc_ps[NUM_PROC_REFS_TO_TRACK];
+ uintptr_t uu_proc_pcs[NUM_PROC_REFS_TO_TRACK][PROC_REF_STACK_DEPTH];
+#endif
+
+#if CONFIG_DTRACE
+ uint32_t t_dtrace_errno; /* Most recent errno */
+ siginfo_t t_dtrace_siginfo;
+ uint64_t t_dtrace_resumepid; /* DTrace's pidresume() pid */
+ uint8_t t_dtrace_stop; /* indicates a DTrace desired stop */
+ uint8_t t_dtrace_sig; /* signal sent via DTrace's raise() */
+
+ union __tdu {
+ struct __tds {
+ uint8_t _t_dtrace_on; /* hit a fasttrap tracepoint */
+ uint8_t _t_dtrace_step; /* about to return to kernel */
+ uint8_t _t_dtrace_ret; /* handling a return probe */
+ uint8_t _t_dtrace_ast; /* saved ast flag */
+#if __sol64 || defined(__APPLE__)
+ uint8_t _t_dtrace_reg; /* modified register */
+#endif
+ } _tds;
+ u_int32_t _t_dtrace_ft; /* bitwise or of these flags */
+ } _tdu;
+#define t_dtrace_ft _tdu._t_dtrace_ft
+#define t_dtrace_on _tdu._tds._t_dtrace_on
+#define t_dtrace_step _tdu._tds._t_dtrace_step
+#define t_dtrace_ret _tdu._tds._t_dtrace_ret
+#define t_dtrace_ast _tdu._tds._t_dtrace_ast
+#if __sol64 || defined(__APPLE__)
+#define t_dtrace_reg _tdu._tds._t_dtrace_reg
+#endif
+
+ user_addr_t t_dtrace_pc; /* DTrace saved pc from fasttrap */
+ user_addr_t t_dtrace_npc; /* DTrace next pc from fasttrap */
+ user_addr_t t_dtrace_scrpc; /* DTrace per-thread scratch location */
+ user_addr_t t_dtrace_astpc; /* DTrace return sequence location */
+
+ struct dtrace_ptss_page_entry* t_dtrace_scratch; /* scratch space entry */
+
+#if __sol64 || defined(__APPLE__)
+ uint64_t t_dtrace_regv; /* DTrace saved reg from fasttrap */
+#endif
+ void *t_dtrace_syscall_args;
+#endif /* CONFIG_DTRACE */
+ char *pth_name;
+
+ /* Document Tracking struct used to track a "tombstone" for a document */
+ struct doc_tombstone *t_tombstone;
+
+ struct os_reason *uu_exit_reason;