Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / threadpool.h
index efb28d34cbba4b6e0b1f75e41713dbfc619345b0..91b404fe275d4a8a981b099d2f7b428c40341c9b 100644 (file)
@@ -1,36 +1,67 @@
-#ifndef _MONO_THREADPOOL_H_
-#define _MONO_THREADPOOL_H_
+/**
+ * \file
+ */
 
+#ifndef _MONO_METADATA_THREADPOOL_H_
+#define _MONO_METADATA_THREADPOOL_H_
+
+#include <config.h>
+#include <glib.h>
+
+#include <mono/metadata/exception.h>
 #include <mono/metadata/object-internals.h>
-#include <mono/metadata/reflection.h>
 
-/* No managed code here */
-void mono_thread_pool_init (void) MONO_INTERNAL;
+typedef struct _MonoNativeOverlapped MonoNativeOverlapped;
 
-MonoAsyncResult *
-mono_thread_pool_add     (MonoObject *target, MonoMethodMessage *msg, 
-                         MonoDelegate *async_callback, MonoObject *state) MONO_INTERNAL;
+void
+mono_threadpool_cleanup (void);
 
+MonoAsyncResult *
+mono_threadpool_begin_invoke (MonoDomain *domain, MonoObject *target, MonoMethod *method, gpointer *params, MonoError *error);
 MonoObject *
-mono_thread_pool_finish (MonoAsyncResult *ares, MonoArray **out_args, 
-                        MonoObject **exc) MONO_INTERNAL;
+mono_threadpool_end_invoke (MonoAsyncResult *ares, MonoArray **out_args, MonoObject **exc, MonoError *error);
 
-void mono_thread_pool_cleanup (void) MONO_INTERNAL;
+gboolean
+mono_threadpool_remove_domain_jobs (MonoDomain *domain, int timeout);
 
 void
-ves_icall_System_Threading_ThreadPool_GetAvailableThreads (int *workerThreads,
-                                                          int *completionPortThreads) MONO_INTERNAL;
-
+mono_threadpool_suspend (void);
 void
-ves_icall_System_Threading_ThreadPool_GetMaxThreads (int *workerThreads,
-                                                    int *completionPortThreads) MONO_INTERNAL;
+mono_threadpool_resume (void);
 
 void
-ves_icall_System_Threading_ThreadPool_GetMinThreads (gint *workerThreads, 
-                                                               gint *completionPortThreads) MONO_INTERNAL;
+ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
+void
+ves_icall_System_Threading_ThreadPool_GetMinThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
+void
+ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative (gint32 *worker_threads, gint32 *completion_port_threads);
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_SetMinThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative (gint32 worker_threads, gint32 completion_port_threads);
+void
+ves_icall_System_Threading_ThreadPool_InitializeVMTp (MonoBoolean *enable_worker_tracking);
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete (void);
+void
+ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative (void);
+void
+ves_icall_System_Threading_ThreadPool_ReportThreadStatus (MonoBoolean is_working);
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_RequestWorkerThread (void);
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus (MonoNativeOverlapped *native_overlapped);
+
+MonoBoolean
+ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative (gpointer file_handle);
 
 MonoBoolean
-ves_icall_System_Threading_ThreadPool_SetMinThreads (gint workerThreads, 
-                                                               gint completionPortThreads) MONO_INTERNAL;
+ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted (void);
+
+/* Internals */
+
+gboolean
+mono_threadpool_enqueue_work_item (MonoDomain *domain, MonoObject *work_item, MonoError *error);
 
-#endif
+#endif // _MONO_METADATA_THREADPOOL_H_