2 * Copyright (c) 1993-1995, 1999-2005 Apple Computer, Inc.
5 * @APPLE_LICENSE_HEADER_START@
7 * The contents of this file constitute Original Code as defined in and
8 * are subject to the Apple Public Source License Version 1.1 (the
9 * "License"). You may not use this file except in compliance with the
10 * License. Please obtain a copy of the License at
11 * http://www.apple.com/publicsource and read it before using this file.
13 * This Original Code and all software distributed under the License are
14 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
18 * License for the specific language governing rights and limitations
21 * @APPLE_LICENSE_HEADER_END@
24 * Declarations for thread-based callouts.
27 #ifndef _KERN_THREAD_CALL_H_
28 #define _KERN_THREAD_CALL_H_
30 #include <mach/mach_types.h>
32 #include <kern/clock.h>
34 #include <sys/cdefs.h>
36 typedef struct call_entry
*thread_call_t
;
37 typedef void *thread_call_param_t
;
38 typedef void (*thread_call_func_t
)(
39 thread_call_param_t param0
,
40 thread_call_param_t param1
);
51 thread_call_param_t param1
55 thread_call_enter_delayed(
61 thread_call_enter1_delayed(
63 thread_call_param_t param1
,
74 thread_call_func_t func
,
75 thread_call_param_t param0
85 #ifdef MACH_KERNEL_PRIVATE
87 #include <kern/call_entry.h>
89 typedef struct call_entry thread_call_data_t
;
92 thread_call_initialize(void);
97 thread_call_func_t func
,
98 thread_call_param_t param0
102 call_thread_block(void),
103 call_thread_unblock(void);
105 #endif /* MACH_KERNEL_PRIVATE */
107 #ifdef KERNEL_PRIVATE
112 * Obsolete interfaces.
116 thread_call_is_delayed(
123 thread_call_func_t func
,
124 thread_call_param_t param
,
125 boolean_t unique_call
129 thread_call_func_delayed(
130 thread_call_func_t func
,
131 thread_call_param_t param
,
136 thread_call_func_cancel(
137 thread_call_func_t func
,
138 thread_call_param_t param
,
142 #ifndef MACH_KERNEL_PRIVATE
144 #ifndef ABSOLUTETIME_SCALAR_TYPE
146 #define thread_call_enter_delayed(a, b) \
147 thread_call_enter_delayed((a), __OSAbsoluteTime(b))
149 #define thread_call_enter1_delayed(a, b, c) \
150 thread_call_enter1_delayed((a), (b), __OSAbsoluteTime(c))
152 #define thread_call_is_delayed(a, b) \
153 thread_call_is_delayed((a), __OSAbsoluteTimePtr(b))
155 #define thread_call_func_delayed(a, b, c) \
156 thread_call_func_delayed((a), (b), __OSAbsoluteTime(c))
158 #endif /* ABSOLUTETIME_SCALAR_TYPE */
160 #endif /* MACH_KERNEL_PRIVATE */
164 #endif /* KERNEL_PRIVATE */
166 #endif /* _KERN_THREAD_CALL_H_ */