+#define THREAD_CALL_DELAY_SYS_NORMAL TIMEOUT_URGENCY_SYS_NORMAL
+#define THREAD_CALL_DELAY_SYS_CRITICAL TIMEOUT_URGENCY_SYS_CRITICAL
+#define THREAD_CALL_DELAY_SYS_BACKGROUND TIMEOUT_URGENCY_SYS_BACKGROUND
+
+#define THREAD_CALL_DELAY_USER_MASK TIMEOUT_URGENCY_USER_MASK
+#define THREAD_CALL_DELAY_USER_NORMAL TIMEOUT_URGENCY_USER_NORMAL
+#define THREAD_CALL_DELAY_USER_CRITICAL TIMEOUT_URGENCY_USER_CRITICAL
+#define THREAD_CALL_DELAY_USER_BACKGROUND TIMEOUT_URGENCY_USER_BACKGROUND
+
+#define THREAD_CALL_DELAY_URGENCY_MASK TIMEOUT_URGENCY_MASK
+
+/*
+ * Indicate that a specific leeway value is being provided (otherwise
+ * the leeway parameter is ignored). The supplied value can currently
+ * only be used to extend the leeway calculated internally from the
+ * urgency class provided.
+ */
+#define THREAD_CALL_DELAY_LEEWAY TIMEOUT_URGENCY_LEEWAY
+
+/*!
+ @function thread_call_enter_delayed_with_leeway
+ @abstract Submit a thread call to be executed at some point in the future.
+ @discussion If the work item is already scheduled for delayed or immediate execution,
+ and it has not yet begun to run, that invocation will be cancelled in favor of execution
+ at the newly specified time. Note that if a thread call is rescheduled from its own callback,
+ then multiple invocations of the callback may be in flight at the same time.
+ @result TRUE if the call was already pending for either delayed or immediate
+ execution, FALSE otherwise.
+ @param call The thread call to execute.
+ @param param1 Second parameter to callback.
+ @param deadline Time, in absolute time units, at which to execute callback.
+ @param leeway Time delta, in absolute time units, which sets range of time allowing kernel
+ to decide appropriate time to run.
+ @param flags configuration for timers in kernel.
+ */
+extern boolean_t thread_call_enter_delayed_with_leeway(
+ thread_call_t call,
+ thread_call_param_t param1,
+ uint64_t deadline,
+ uint64_t leeway,
+ uint32_t flags);
+
+#endif /* XNU_KERNEL_PRIVATE */
+
+/*!
+ @function thread_call_cancel
+ @abstract Attempt to cancel a pending invocation of a thread call.
+ @discussion Attempt to cancel a thread call which has been scheduled
+ for execution with a thread_call_enter* variant. If the call has not
+ yet begun executing, the pending invocation will be cancelled and TRUE
+ will be returned. If the work item has already begun executing,
+ thread_call_cancel will return FALSE immediately; the callback may be
+ about to run, currently running, or already done executing.
+ @result TRUE if the call was successfully cancelled, FALSE otherwise.
+ */
+extern boolean_t thread_call_cancel(
+ thread_call_t call);
+/*!
+ @function thread_call_cancel_wait
+ @abstract Attempt to cancel a pending invocation of a thread call.
+ If unable to cancel, wait for current invocation to finish.
+ @discussion Attempt to cancel a thread call which has been scheduled
+ for execution with a thread_call_enter* variant. If the call has not
+ yet begun executing, the pending invocation will be cancelled and TRUE
+ will be returned. If the work item has already begun executing,
+ thread_call_cancel_wait waits for the most recent invocation to finish. When
+ called on a work item which has already finished, it will return FALSE immediately.
+ Note that this routine can only be used on thread calls set up with either
+ thread_call_allocate or thread_call_allocate_with_priority, and that invocations
+ of the thread call <i>after</i> the current invocation may be in flight when
+ thread_call_cancel_wait returns.
+ @result TRUE if the call was successfully cancelled, FALSE otherwise.
+ */
+extern boolean_t thread_call_cancel_wait(
+ thread_call_t call);
+
+ /*!
+ @function thread_call_allocate
+ @abstract Allocate a thread call to execute with default (high) priority.
+ @discussion Allocates a thread call that will run with properties of
+ THREAD_CALL_PRIORITY_HIGH, binding the first parameter to the callback.
+ @param func Callback to invoke when thread call is scheduled.
+ @param param0 First argument ot pass to callback.
+ @result Thread call which can be passed to thread_call_enter variants.
+ */
+extern thread_call_t thread_call_allocate(
+ thread_call_func_t func,
+ thread_call_param_t param0);
+
+ /*!
+ @function thread_call_allocate_with_priority
+ @abstract Allocate a thread call to execute with a specified priority.
+ @discussion Identical to thread_call_allocate, except that priority
+ is specified by caller.
+ @param func Callback to invoke when thread call is scheduled.
+ @param param0 First argument to pass to callback.
+ @param pri Priority of item.
+ @result Thread call which can be passed to thread_call_enter variants.
+ */
+extern thread_call_t thread_call_allocate_with_priority(
+ thread_call_func_t func,
+ thread_call_param_t param0,
+ thread_call_priority_t pri);
+
+/*!
+ @function thread_call_free
+ @abstract Release a thread call.
+ @discussion Should only be used on thread calls allocated with thread_call_allocate
+ or thread_call_allocate_with_priority. Once thread_call_free has been called,
+ no other operations may be performed on a thread call. If the thread call is
+ currently pending, thread_call_free will return FALSE and will have no effect.
+ Calling thread_call_free from a thread call's own callback is safe; the work
+ item is not considering "pending" at that point.
+ @result TRUE if the thread call has been successfully released, else FALSE.
+ @param call The thread call to release.
+ */
+extern boolean_t thread_call_free(
+ thread_call_t call);
+
+/*!
+ @function thread_call_isactive
+ @abstract Determine whether a thread call is pending or currently executing.
+ @param call Thread call to examine.
+ @result TRUE if the thread call is either scheduled for execution (immediately
+ or at some point in the future) or is currently executing.
+ */
+boolean_t thread_call_isactive(
+ thread_call_t call);
+__END_DECLS
+
+#ifdef MACH_KERNEL_PRIVATE