imported everything from my branch (which is slightly harmless).
[mono.git] / mono / io-layer / thread-private.h
1 /*
2  * thread-private.h:  Private definitions for thread handles
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_THREAD_PRIVATE_H_
11 #define _WAPI_THREAD_PRIVATE_H_
12
13 #include <config.h>
14 #include <glib.h>
15
16 #include <mono/io-layer/timed-thread.h>
17
18 extern struct _WapiHandleOps _wapi_thread_ops;
19
20 typedef enum {
21         THREAD_STATE_START,
22         THREAD_STATE_EXITED
23 } WapiThreadState;
24
25 struct _WapiHandle_thread
26 {
27         WapiThreadState state;
28         guint32 exitstatus;
29         pid_t owner_pid;
30         TimedThread *thread;
31         gboolean joined;
32         GPtrArray *owned_mutexes;
33 };
34
35 extern gboolean _wapi_thread_apc_pending (gpointer handle);
36 extern gboolean _wapi_thread_cur_apc_pending (void);
37 extern gboolean _wapi_thread_dispatch_apc_queue (gpointer handle);
38 extern gpointer _wapi_thread_handle_from_id (guint32 tid);
39 extern void _wapi_thread_own_mutex (pthread_t tid, gpointer mutex);
40 extern void _wapi_thread_disown_mutex (pthread_t tid, gpointer mutex);
41
42
43 #endif /* _WAPI_THREAD_PRIVATE_H_ */