threadpool-ms.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #pragma once
  2. #if NET_4_0
  3. #include "il2cpp-config.h"
  4. #include "mono/ThreadPool/ThreadPoolDataStructures.h"
  5. struct Il2CppObject;
  6. struct Il2CppDomain;
  7. struct Il2CppArray;
  8. struct Il2CppAsyncResult;
  9. struct MethodInfo;
  10. struct Il2CppNativeOverlapped;
  11. #define SMALL_STACK (sizeof (void*) * 32 * 1024)
  12. void threadpool_ms_cleanup(void);
  13. Il2CppAsyncResult * threadpool_ms_begin_invoke(Il2CppDomain *domain, Il2CppObject *target, MethodInfo *method, void* *params);
  14. Il2CppObject * threadpool_ms_end_invoke(Il2CppAsyncResult *ares, Il2CppArray **out_args, Il2CppObject **exc);
  15. void threadpool_ms_suspend(void);
  16. void threadpool_ms_resume(void);
  17. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_GetAvailableThreadsNative(int32_t *worker_threads, int32_t *completion_port_threads);
  18. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_GetMinThreadsNative(int32_t *worker_threads, int32_t *completion_port_threads);
  19. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_GetMaxThreadsNative(int32_t *worker_threads, int32_t *completion_port_threads);
  20. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_SetMinThreadsNative(int32_t worker_threads, int32_t completion_port_threads);
  21. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_SetMaxThreadsNative(int32_t worker_threads, int32_t completion_port_threads);
  22. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_InitializeVMTp(bool *enable_worker_tracking);
  23. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_NotifyWorkItemComplete(void);
  24. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_NotifyWorkItemProgressNative(void);
  25. LIBIL2CPP_CODEGEN_API void ves_icall_System_Threading_ThreadPool_ReportThreadStatus(bool is_working);
  26. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_RequestWorkerThread(void);
  27. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_PostQueuedCompletionStatus(Il2CppNativeOverlapped *native_overlapped);
  28. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_BindIOCompletionCallbackNative(void* file_handle);
  29. LIBIL2CPP_CODEGEN_API bool ves_icall_System_Threading_ThreadPool_IsThreadPoolHosted(void);
  30. /* Internals */
  31. bool threadpool_ms_enqueue_work_item(Il2CppDomain *domain, Il2CppObject *work_item);
  32. extern ThreadPool* g_ThreadPool;
  33. bool worker_try_unpark();
  34. void hill_climbing_force_change(int16_t new_thread_count, ThreadPoolHeuristicStateTransition transition);
  35. #endif