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);
10 void mono_thread_pool_init_tls (void);
12 void icall_append_job (MonoObject *ar);
13 void icall_append_io_job (MonoObject *target, MonoSocketAsyncResult *state);
16 mono_thread_pool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params);
19 mono_thread_pool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc);
21 void mono_thread_pool_cleanup (void);
23 gboolean mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout);
25 void mono_thread_pool_suspend (void);
26 void mono_thread_pool_resume (void);
29 ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
30 int *completionPortThreads);
33 ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
34 int *completionPortThreads);
37 ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads,
38 gint *completionPortThreads);
41 ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads,
42 gint completionPortThreads);
45 ves_icall_System_Threading_ThreadPool_SetMaxThreads (gint workerThreads,
46 gint completionPortThreads);
48 typedef void (*MonoThreadPoolFunc) (gpointer user_data);
49 MONO_API void mono_install_threadpool_thread_hooks (MonoThreadPoolFunc start_func, MonoThreadPoolFunc finish_func, gpointer user_data);
51 typedef void (*MonoThreadPoolItemFunc) (gpointer user_data);
52 MONO_API void mono_install_threadpool_item_hooks (MonoThreadPoolItemFunc begin_func, MonoThreadPoolItemFunc end_func, gpointer user_data);