2 * Copyright (c) 1993-1995, 1999-2005 Apple Computer, Inc.
5 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
7 * This file contains Original Code and/or Modifications of Original Code
8 * as defined in and that are subject to the Apple Public Source License
9 * Version 2.0 (the 'License'). You may not use this file except in
10 * compliance with the License. The rights granted to you under the License
11 * may not be used to create, or enable the creation or redistribution of,
12 * unlawful or unlicensed copies of an Apple operating system, or to
13 * circumvent, violate, or enable the circumvention or violation of, any
14 * terms of an Apple operating system software license agreement.
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this file.
19 * The Original Code and all software distributed under the License are
20 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
21 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
22 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
24 * Please see the License for the specific language governing rights and
25 * limitations under the License.
27 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
30 * Declarations for thread-based callouts.
33 #ifndef _KERN_THREAD_CALL_H_
34 #define _KERN_THREAD_CALL_H_
36 #include <mach/mach_types.h>
38 #include <kern/clock.h>
40 #include <sys/cdefs.h>
42 typedef struct call_entry
*thread_call_t
;
43 typedef void *thread_call_param_t
;
44 typedef void (*thread_call_func_t
)(
45 thread_call_param_t param0
,
46 thread_call_param_t param1
);
57 thread_call_param_t param1
61 thread_call_enter_delayed(
67 thread_call_enter1_delayed(
69 thread_call_param_t param1
,
80 thread_call_func_t func
,
81 thread_call_param_t param0
91 #ifdef MACH_KERNEL_PRIVATE
93 #include <kern/call_entry.h>
95 typedef struct call_entry thread_call_data_t
;
98 thread_call_initialize(void);
103 thread_call_func_t func
,
104 thread_call_param_t param0
108 call_thread_block(void),
109 call_thread_unblock(void);
111 #endif /* MACH_KERNEL_PRIVATE */
113 #ifdef KERNEL_PRIVATE
118 * Obsolete interfaces.
122 thread_call_is_delayed(
129 thread_call_func_t func
,
130 thread_call_param_t param
,
131 boolean_t unique_call
135 thread_call_func_delayed(
136 thread_call_func_t func
,
137 thread_call_param_t param
,
142 thread_call_func_cancel(
143 thread_call_func_t func
,
144 thread_call_param_t param
,
148 #ifndef MACH_KERNEL_PRIVATE
150 #ifndef ABSOLUTETIME_SCALAR_TYPE
152 #define thread_call_enter_delayed(a, b) \
153 thread_call_enter_delayed((a), __OSAbsoluteTime(b))
155 #define thread_call_enter1_delayed(a, b, c) \
156 thread_call_enter1_delayed((a), (b), __OSAbsoluteTime(c))
158 #define thread_call_is_delayed(a, b) \
159 thread_call_is_delayed((a), __OSAbsoluteTimePtr(b))
161 #define thread_call_func_delayed(a, b, c) \
162 thread_call_func_delayed((a), (b), __OSAbsoluteTime(c))
164 #endif /* ABSOLUTETIME_SCALAR_TYPE */
166 #endif /* MACH_KERNEL_PRIVATE */
170 #endif /* KERNEL_PRIVATE */
172 #endif /* _KERN_THREAD_CALL_H_ */