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 _MonoNativeOverlapped MonoNativeOverlapped;
21 static void G_GNUC_UNUSED
22 mono_threadpool_ms_init (void)
24 /* Initialization is done lazily */
27 static void G_GNUC_UNUSED
28 mono_threadpool_ms_init_tls (void)
30 /* The WSQ is now implemented in managed */
34 mono_threadpool_ms_cleanup (void);
37 mono_threadpool_ms_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params);
39 mono_threadpool_ms_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
42 mono_threadpool_ms_remove_domain_jobs (MonoDomain *domain, int timeout);
45 mono_threadpool_ms_suspend (void);
47 mono_threadpool_ms_resume (void);
49 static gboolean G_GNUC_UNUSED
50 mono_threadpool_ms_is_queue_array (MonoArray *arr)
52 /* The queue is in managed code */
57 ves_icall_System_Threading_Microsoft_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
59 ves_icall_System_Threading_Microsoft_ThreadPool_GetMinThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
61 ves_icall_System_Threading_Microsoft_ThreadPool_GetMaxThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
63 ves_icall_System_Threading_Microsoft_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
65 ves_icall_System_Threading_Microsoft_ThreadPool_SetMaxThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
67 ves_icall_System_Threading_Microsoft_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking);
69 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemComplete (void);
71 ves_icall_System_Threading_Microsoft_ThreadPool_NotifyWorkItemProgressNative (void);
73 ves_icall_System_Threading_Microsoft_ThreadPool_ReportThreadStatus (MonoBoolean is_working);
75 ves_icall_System_Threading_Microsoft_ThreadPool_RequestWorkerThread (void);
78 ves_icall_System_Threading_Microsoft_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
81 ves_icall_System_Threading_Microsoft_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
84 ves_icall_System_Threading_Microsoft_ThreadPool_IsThreadPoolHosted (void);
89 mono_threadpool_ms_enqueue_work_item (MonoDomain *domain, MonoObject *work_item);
91 #endif // _MONO_THREADPOOL_MICROSOFT_H_