Pass the --clr-memory-model flag on the command line instead of MONO_DEBUG so its...
[mono-project.git] / mono / metadata / threadpool-worker-wasm.c
blob8877df96025bcc0df2d26867aaa49e15c34720e2
1 /**
2 * \file
3 * native threadpool worker
5 * Author:
6 * Ludovic Henry (ludovic.henry@xamarin.com)
8 * Licensed under the MIT license. See LICENSE file in the project root for full license information.
9 */
11 #include <stdlib.h>
12 #define _USE_MATH_DEFINES // needed by MSVC to define math constants
13 #include <math.h>
14 #include <config.h>
15 #include <glib.h>
17 #include <mono/metadata/threadpool.h>
18 #include <mono/metadata/threadpool-worker.h>
20 static MonoThreadPoolWorkerCallback tp_cb;
21 static gboolean cb_scheduled;
23 void
24 mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback)
26 tp_cb = callback;
29 void
30 mono_threadpool_worker_cleanup (void)
34 gint32
35 mono_threadpool_worker_get_min (void)
37 return 1;
40 gboolean
41 mono_threadpool_worker_set_min (gint32 value)
43 return value == 1;
46 gint32
47 mono_threadpool_worker_get_max (void)
49 return 1;
52 gboolean
53 mono_threadpool_worker_set_max (gint32 value)
55 return value == 1;
58 static void
59 fire_tp_callback (void)
61 cb_scheduled = FALSE;
62 tp_cb ();
65 void
66 mono_threadpool_worker_request (void)
68 if (!cb_scheduled)
69 mono_threads_schedule_background_job (fire_tp_callback);
70 cb_scheduled = TRUE;
73 gboolean
74 mono_threadpool_worker_notify_completed (void)
76 return FALSE;