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