1 #ifndef _MONO_THREADPOOL_MICROSOFT_H_
2 #define _MONO_THREADPOOL_MICROSOFT_H_
7 #include <mono/metadata/exception.h>
9 #define SMALL_STACK (sizeof (gpointer) * 32 * 1024)
12 STATUS_NOT_INITIALIZED,
19 typedef struct _MonoRuntimeWorkItem MonoRuntimeWorkItem;
20 typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
22 static void G_GNUC_UNUSED
23 mono_threadpool_ms_init (void)
25 /* Initialization is done lazily */
28 static void G_GNUC_UNUSED
29 mono_threadpool_ms_init_tls (void)
31 /* The WSQ is now implemented in managed */
35 mono_threadpool_ms_cleanup (void);
38 mono_threadpool_ms_add (MonoObject *target, MonoMethodMessage *msg, MonoDelegate *async_callback, MonoObject *state);
40 mono_threadpool_ms_finish (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
43 mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
46 mono_threadpool_ms_suspend (void);
48 mono_threadpool_ms_resume (void);
50 static gboolean G_GNUC_UNUSED
51 mono_threadpool_ms_is_queue_array (MonoArray *arr)
53 /* The queue is in managed code */
58 ves_icall_System_Threading_MonoRuntimeWorkItem_ExecuteWorkItem (MonoRuntimeWorkItem *rwi);
61 ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint *worker_threads, gint *completion_port_threads);
63 ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint *worker_threads, gint *completion_port_threads);
65 ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint *worker_threads, gint *completion_port_threads);
67 ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint worker_threads, gint completion_port_threads);
69 ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint worker_threads, gint completion_port_threads);
71 ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (gboolean *enable_worker_tracking);
73 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
75 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
77 ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (gboolean is_working);
79 ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
81 static gboolean G_GNUC_UNUSED
82 ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped)
84 /* This copy the behavior of the current Mono implementation */
85 mono_raise_exception (mono_get_exception_not_implemented (NULL));
89 static gboolean G_GNUC_UNUSED
90 ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle)
92 /* This copy the behavior of the current Mono implementation */
96 static gboolean G_GNUC_UNUSED
97 ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void)
105 mono_threadpool_ms_enqueue_async_result (MonoDomain *domain, MonoAsyncResult *async_result);
107 mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item);
109 #endif // _MONO_THREADPOOL_MICROSOFT_H_