2 * Copyright (c) 1993-1995, 1999-2000 Apple Computer, Inc.
5 * @APPLE_LICENSE_HEADER_START@
7 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
9 * This file contains Original Code and/or Modifications of Original Code
10 * as defined in and that are subject to the Apple Public Source License
11 * Version 2.0 (the 'License'). You may not use this file except in
12 * compliance with the License. Please obtain a copy of the License at
13 * http://www.opensource.apple.com/apsl/ and read it before using this
16 * The Original Code and all software distributed under the License are
17 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
18 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
19 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
21 * Please see the License for the specific language governing rights and
22 * limitations under the License.
24 * @APPLE_LICENSE_HEADER_END@
27 * Declarations for thread-based callouts.
32 * Pulled into Mac OS X (microkernel).
38 #ifndef _KERN_THREAD_CALL_H_
39 #define _KERN_THREAD_CALL_H_
41 #include <sys/appleapiopts.h>
43 #include <mach/mach_types.h>
45 #include <kern/clock.h>
47 typedef struct call_entry
*thread_call_t
;
48 typedef void *thread_call_param_t
;
49 typedef void (*thread_call_func_t
)(
50 thread_call_param_t param0
,
51 thread_call_param_t param1
);
60 thread_call_param_t param1
63 thread_call_enter_delayed(
68 thread_call_enter1_delayed(
70 thread_call_param_t param1
,
78 thread_call_is_delayed(
85 thread_call_func_t func
,
86 thread_call_param_t param0
93 #ifdef __APPLE_API_PRIVATE
95 #ifdef __APPLE_API_OBSOLETE
98 * This portion of the interface
99 * is OBSOLETE and DEPRECATED. It
100 * will disappear shortly.
105 thread_call_func_t func
,
106 thread_call_param_t param
,
107 boolean_t unique_call
110 thread_call_func_delayed(
111 thread_call_func_t func
,
112 thread_call_param_t param
,
117 thread_call_func_cancel(
118 thread_call_func_t func
,
119 thread_call_param_t param
,
123 /* End OBSOLETE and DEPRECATED */
125 #endif /* __APPLE_API_OBSOLETE */
127 #ifdef MACH_KERNEL_PRIVATE
128 #include <kern/call_entry.h>
130 typedef struct call_entry thread_call_data_t
;
133 thread_call_initialize(void);
138 thread_call_func_t func
,
139 thread_call_param_t param0
143 call_thread_block(void),
144 call_thread_unblock(void);
146 #endif /* MACH_KERNEL_PRIVATE */
148 #endif /* __APPLE_API_PRIVATE */
150 #if !defined(MACH_KERNEL_PRIVATE) && !defined(ABSOLUTETIME_SCALAR_TYPE)
152 #include <libkern/OSBase.h>
154 #define thread_call_enter_delayed(a, b) \
155 thread_call_enter_delayed((a), __OSAbsoluteTime(b))
157 #define thread_call_enter1_delayed(a, b, c) \
158 thread_call_enter1_delayed((a), (b), __OSAbsoluteTime(c))
160 #define thread_call_is_delayed(a, b) \
161 thread_call_is_delayed((a), __OSAbsoluteTimePtr(b))
163 #define thread_call_func_delayed(a, b, c) \
164 thread_call_func_delayed((a), (b), __OSAbsoluteTime(c))
168 #endif /* _KERN_THREAD_CALL_H_ */