1603e3a15d998d18b152aa88eb104ec6e4ee1e03
[mono.git] / mono / metadata / threadpool-ms.h
1 #ifndef _MONO_THREADPOOL_MICROSOFT_H_
2 #define _MONO_THREADPOOL_MICROSOFT_H_
3
4 #include <config.h>
5 #include <glib.h>
6
7 #include <mono/metadata/exception.h>
8 #include <mono/metadata/object-internals.h>
9
10 #define SMALL_STACK (sizeof (gpointer) * 32 * 1024)
11
12 typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
13
14 void
15 mono_threadpool_ms_cleanup (void);
16
17 MonoAsyncResult *
18 mono_threadpool_ms_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params, MonoError *error);
19 MonoObject *
20 mono_threadpool_ms_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc, MonoError *error);
21
22 gboolean
23 mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
24
25 void
26 mono_threadpool_ms_suspend (void);
27 void
28 mono_threadpool_ms_resume (void);
29
30 void
31 ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
32 void
33 ves_icall_System_Threading_ThreadPool_GetMinThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
34 void
35 ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
36 MonoBoolean
37 ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
38 MonoBoolean
39 ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
40 void
41 ves_icall_System_Threading_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking);
42 MonoBoolean
43 ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete (void);
44 void
45 ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative (void);
46 void
47 ves_icall_System_Threading_ThreadPool_ReportThreadStatus (MonoBoolean is_working);
48 MonoBoolean
49 ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void);
50
51 MonoBoolean
52 ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
53
54 MonoBoolean
55 ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
56
57 MonoBoolean
58 ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted (void);
59
60 /* Internals */
61
62 gboolean
63 mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, MonoError *error);
64
65 #endif // _MONO_THREADPOOL_MICROSOFT_H_