412f0f1ebe89acbe106fc605c82312e054628d61
[mono.git] / mono / io-layer / threads.h
1 /*
2  * threads.h:  Thread handles
3  *
4  * Author:
5  *      Dick Porter (dick@ximian.com)
6  *
7  * (C) 2002 Ximian, Inc.
8  */
9
10 #ifndef _WAPI_THREADS_H_
11 #define _WAPI_THREADS_H_
12
13 #include <glib.h>
14
15 #include <mono/io-layer/io.h>
16 #include <mono/io-layer/status.h>
17 #include <mono/io-layer/processes.h>
18 #include <mono/io-layer/access.h>
19
20 G_BEGIN_DECLS
21
22 #define STILL_ACTIVE STATUS_PENDING
23
24 #define THREAD_ALL_ACCESS               (STANDARD_RIGHTS_REQUIRED|SYNCHRONIZE|0x3ff)
25
26 typedef guint32 (*WapiThreadStart)(gpointer);
27  
28 typedef enum {
29         THREAD_PRIORITY_LOWEST = -2,
30         THREAD_PRIORITY_BELOW_NORMAL = -1,
31         THREAD_PRIORITY_NORMAL = 0,
32         THREAD_PRIORITY_ABOVE_NORMAL = 1,
33         THREAD_PRIORITY_HIGHEST = 2
34 } WapiThreadPriority;
35
36 gpointer wapi_create_thread_handle (void);
37 void wapi_thread_handle_set_exited (gpointer handle, guint32 exitstatus);
38 void wapi_ref_thread_handle (gpointer handle);
39 gpointer wapi_get_current_thread_handle (void);
40
41 char *wapi_current_thread_desc (void);
42
43 extern gint32 GetThreadPriority (gpointer handle);
44 extern gboolean SetThreadPriority (gpointer handle, gint32 priority);
45
46 extern int wapi_thread_priority_to_posix_priority (WapiThreadPriority, int);
47 extern void wapi_init_thread_info_priority (gpointer, gint32);
48
49 G_END_DECLS
50 #endif /* _WAPI_THREADS_H_ */