[threads] Remove mono_threads_create_thread (#4411)
[mono.git] / mono / metadata / threadpool.h
1 #ifndef _MONO_METADATA_THREADPOOL_H_
2 #define _MONO_METADATA_THREADPOOL_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 typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
11
12 void
13 mono_threadpool_cleanup (void);
14
15 MonoAsyncResult *
16 mono_threadpool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params, MonoError *error);
17 MonoObject *
18 mono_threadpool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc, MonoError *error);
19
20 gboolean
21 mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout);
22
23 void
24 mono_threadpool_suspend (void);
25 void
26 mono_threadpool_resume (void);
27
28 void
29 ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
30 void
31 ves_icall_System_Threading_ThreadPool_GetMinThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
32 void
33 ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
34 MonoBoolean
35 ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
36 MonoBoolean
37 ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
38 void
39 ves_icall_System_Threading_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking);
40 MonoBoolean
41 ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete (void);
42 void
43 ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative (void);
44 void
45 ves_icall_System_Threading_ThreadPool_ReportThreadStatus (MonoBoolean is_working);
46 MonoBoolean
47 ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void);
48
49 MonoBoolean
50 ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
51
52 MonoBoolean
53 ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
54
55 MonoBoolean
56 ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted (void);
57
58 /* Internals */
59
60 gboolean
61 mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, MonoError *error);
62
63 #endif // _MONO_METADATA_THREADPOOL_H_