1 #ifndef _MONO_THREADPOOL_H_
2 #define _MONO_THREADPOOL_H_
4 #include <mono/metadata/object-internals.h>
5 #include <mono/metadata/reflection.h>
6 #include <mono/metadata/socket-io.h>
8 /* No managed code here */
9 void mono_thread_pool_init (void) MONO_INTERNAL;
11 void icall_append_job (MonoObject *ar) MONO_INTERNAL;
12 void icall_append_io_job (MonoObject *target, MonoSocketAsyncResult *state) MONO_INTERNAL;
14 mono_thread_pool_add (MonoObject *target, MonoMethodMessage *msg,
15 MonoDelegate *async_callback, MonoObject *state) MONO_INTERNAL;
18 mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args,
19 MonoObject **exc) MONO_INTERNAL;
21 void mono_thread_pool_cleanup (void) MONO_INTERNAL;
23 gboolean mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout) MONO_INTERNAL;
25 void mono_thread_pool_suspend (void) MONO_INTERNAL;
26 void mono_thread_pool_resume (void) MONO_INTERNAL;
29 ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
30 int *completionPortThreads) MONO_INTERNAL;
33 ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
34 int *completionPortThreads) MONO_INTERNAL;
37 ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads,
38 gint *completionPortThreads) MONO_INTERNAL;
41 ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads,
42 gint completionPortThreads) MONO_INTERNAL;
45 ves_icall_System_Threading_ThreadPool_SetMaxThreads (gint workerThreads,
46 gint completionPortThreads) MONO_INTERNAL;
48 typedef void (*MonoThreadPoolFunc) (gpointer user_data);
49 void mono_install_threadpool_thread_hooks (MonoThreadPoolFunc start_func, MonoThreadPoolFunc finish_func, gpointer user_data);
51 typedef void (*MonoThreadPoolItemFunc) (gpointer user_data);
52 void mono_install_threadpool_item_hooks (MonoThreadPoolItemFunc begin_func, MonoThreadPoolItemFunc end_func, gpointer user_data);