2 * thread-private.h: Private definitions for thread handles
5 * Dick Porter (dick@ximian.com)
7 * (C) 2002 Ximian, Inc.
10 #ifndef _WAPI_THREAD_PRIVATE_H_
11 #define _WAPI_THREAD_PRIVATE_H_
16 #include <mono/utils/mono-semaphore.h>
18 /* There doesn't seem to be a defined symbol for this */
19 #define _WAPI_THREAD_CURRENT (gpointer)0xFFFFFFFE
20 extern gpointer
_wapi_thread_duplicate (void);
22 extern struct _WapiHandleOps _wapi_thread_ops
;
29 #define INTERRUPTION_REQUESTED_HANDLE (gpointer)0xFFFFFFFE
31 struct _WapiHandle_thread
34 WapiThreadState state
: 2;
38 /* Fields below this point are only valid for the owning process */
40 GPtrArray
*owned_mutexes
;
43 * Handle this thread waits on. If this is INTERRUPTION_REQUESTED_HANDLE,
44 * it means the thread is interrupted by another thread, and shouldn't enter
46 * This also acts as a reference for the handle.
49 MonoSemType suspend_sem
;
50 guint32 (*start_routine
)(gpointer arg
);
56 guint32 (*callback
)(gpointer arg
);
60 extern gboolean
_wapi_thread_apc_pending (gpointer handle
);
61 extern gboolean
_wapi_thread_cur_apc_pending (void);
62 extern gboolean
_wapi_thread_dispatch_apc_queue (gpointer handle
);
63 extern void _wapi_thread_own_mutex (gpointer mutex
);
64 extern void _wapi_thread_disown_mutex (gpointer mutex
);
65 extern gpointer
_wapi_thread_handle_from_id (pthread_t tid
);
66 extern void _wapi_thread_set_termination_details (gpointer handle
,
68 extern void _wapi_thread_cleanup (void);
70 #endif /* _WAPI_THREAD_PRIVATE_H_ */