Merge branch 'master' of https://github.com/mono/mono
[mono.git] / mono / metadata / threadpool.h
1 #ifndef _MONO_THREADPOOL_H_
2 #define _MONO_THREADPOOL_H_
3
4 #include <mono/metadata/object-internals.h>
5 #include <mono/metadata/reflection.h>
6 #include <mono/metadata/socket-io.h>
7
8 /* No managed code here */
9 void mono_thread_pool_init (void) MONO_INTERNAL;
10
11 void icall_append_job (MonoObject *ar) MONO_INTERNAL;
12 void icall_append_io_job (MonoObject *target, MonoSocketAsyncResult *state) MONO_INTERNAL;
13 MonoAsyncResult *
14 mono_thread_pool_add     (MonoObject *target, MonoMethodMessage *msg, 
15                           MonoDelegate *async_callback, MonoObject *state) MONO_INTERNAL;
16
17 MonoObject *
18 mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, 
19                          MonoObject **exc) MONO_INTERNAL;
20
21 void mono_thread_pool_cleanup (void) MONO_INTERNAL;
22
23 gboolean mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout) MONO_INTERNAL;
24
25 void mono_thread_pool_suspend (void) MONO_INTERNAL;
26 void mono_thread_pool_resume (void) MONO_INTERNAL;
27
28 void
29 ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
30                                                            int *completionPortThreads) MONO_INTERNAL;
31
32 void
33 ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
34                                                      int *completionPortThreads) MONO_INTERNAL;
35
36 void
37 ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads, 
38                                                                 gint *completionPortThreads) MONO_INTERNAL;
39
40 MonoBoolean
41 ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads, 
42                                                                 gint completionPortThreads) MONO_INTERNAL;
43
44 MonoBoolean
45 ves_icall_System_Threading_ThreadPool_SetMaxThreads (gint workerThreads, 
46                                                                 gint completionPortThreads) MONO_INTERNAL;
47
48 typedef void  (*MonoThreadPoolFunc) (gpointer user_data);
49 void mono_install_threadpool_thread_hooks (MonoThreadPoolFunc start_func, MonoThreadPoolFunc finish_func, gpointer user_data);
50
51 typedef void  (*MonoThreadPoolItemFunc) (gpointer user_data);
52 void mono_install_threadpool_item_hooks (MonoThreadPoolItemFunc begin_func, MonoThreadPoolItemFunc end_func, gpointer user_data);
53
54 #endif
55