Merge pull request #1636 from alexrp/profiler-stuff
[mono.git] / mono / metadata / threadpool-microsoft.h
1 #ifndef _MONO_THREADPOOL_MICROSOFT_H_
2 #define _MONO_THREADPOOL_MICROSOFT_H_
3
4 #include <glib.h>
5
6 typedef struct _MonoRuntimeWorkItem MonoRuntimeWorkItem;
7 typedef struct _MonoRegisteredWaitHandle MonoRegisteredWaitHandle;
8 typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
9
10 static void
11 mono_thread_pool_ms_init (void)
12 {
13         /* Initialization is done lazily */
14 }
15
16 static void
17 mono_thread_pool_ms_init_tls (void)
18 {
19         /* The WSQ is now implemented in managed */
20 }
21
22 void
23 mono_thread_pool_ms_cleanup (void);
24
25 MonoAsyncResult *
26 mono_thread_pool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state);
27 MonoObject *
28 mono_thread_pool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
29
30 gboolean
31 mono_thread_pool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
32 void
33 mono_thread_pool_ms_remove_socket (int sock);
34
35 void
36 mono_thread_pool_ms_suspend (void);
37 void
38 mono_thread_pool_ms_resume (void);
39
40 static gboolean
41 mono_thread_pool_ms_is_queue_array (MonoArray *arr)
42 {
43         /* The queue is in managed code */
44         return FALSE;
45 }
46
47 void
48 ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi);
49
50 void
51 ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads);
52 void
53 ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads);
54 void
55 ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads);
56 gboolean
57 ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads);
58 gboolean
59 ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads);
60 void
61 ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking);
62 gboolean
63 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
64 void
65 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
66 void
67 ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working);
68 gboolean
69 ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
70 gboolean
71 ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
72 gpointer
73 ves_icall_System_Threading_Microsoft_ThreadPool_RegisterWaitForSingleObjectNative (MonoWaitHandle *wait_handle, MonoObject *state, guint timeout_internal, gboolean execute_only_once, MonoRegisteredWaitHandle *registered_wait_handle, gint stack_mark, gboolean compress_stack);
74 gboolean
75 ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
76
77 static gboolean
78 ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
79 {
80         return FALSE;
81 }
82
83 #endif // _MONO_THREADPOOL_MICROSOFT_H_