Merge pull request #727 from alesliehughes/master
[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 void mono_thread_pool_init_tls (void) MONO_INTERNAL;
11
12 void icall_append_job (MonoObject *ar) MONO_INTERNAL;
13 void icall_append_io_job (MonoObject *target, MonoSocketAsyncResult *state) MONO_INTERNAL;
14 MonoAsyncResult *
15 mono_thread_pool_add     (MonoObject *target, MonoMethodMessage *msg, 
16                           MonoDelegate *async_callback, MonoObject *state) MONO_INTERNAL;
17
18 MonoObject *
19 mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, 
20                          MonoObject **exc) MONO_INTERNAL;
21
22 void mono_thread_pool_cleanup (void) MONO_INTERNAL;
23
24 gboolean mono_thread_pool_remove_domain_jobs (MonoDomain *domain, int timeout) MONO_INTERNAL;
25
26 void mono_thread_pool_suspend (void) MONO_INTERNAL;
27 void mono_thread_pool_resume (void) MONO_INTERNAL;
28
29 void
30 ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
31                                                            int *completionPortThreads) MONO_INTERNAL;
32
33 void
34 ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
35                                                      int *completionPortThreads) MONO_INTERNAL;
36
37 void
38 ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads, 
39                                                                 gint *completionPortThreads) MONO_INTERNAL;
40
41 MonoBoolean
42 ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads, 
43                                                                 gint completionPortThreads) MONO_INTERNAL;
44
45 MonoBoolean
46 ves_icall_System_Threading_ThreadPool_SetMaxThreads (gint workerThreads, 
47                                                                 gint completionPortThreads) MONO_INTERNAL;
48
49 typedef void  (*MonoThreadPoolFunc) (gpointer user_data);
50 MONO_API void mono_install_threadpool_thread_hooks (MonoThreadPoolFunc start_func, MonoThreadPoolFunc finish_func, gpointer user_data);
51
52 typedef void  (*MonoThreadPoolItemFunc) (gpointer user_data);
53 MONO_API void mono_install_threadpool_item_hooks (MonoThreadPoolItemFunc begin_func, MonoThreadPoolItemFunc end_func, gpointer user_data);
54
55 #endif
56