[wasm] Add threading, dl and hwcap support for wasm.
[mono.git] / mono / utils / mono-threads.h
index c9686815011f19e814d2283f50c4430994712dc0..ffa9de63a66e5468d8cd5fe58989202cb73755b1 100644 (file)
@@ -109,7 +109,9 @@ and reduce the number of casts drastically.
 /* If this is defined, use the signals backed on Mach. Debug only as signals can't be made usable on OSX. */
 // #define USE_SIGNALS_ON_MACH
 
-#if defined (_POSIX_VERSION)
+#ifdef HOST_WASM
+#define USE_WASM_BACKEND
+#elif defined (_POSIX_VERSION)
 #if defined (__MACH__) && !defined (USE_SIGNALS_ON_MACH)
 #define USE_MACH_BACKEND
 #else
@@ -222,6 +224,12 @@ typedef struct {
 
        /* GCHandle to MonoInternalThread */
        guint32 internal_thread_gchandle;
+
+       /*
+        * Used by the sampling code in mini-posix.c to ensure that a thread has
+        * handled a sampling signal before sending another one.
+        */
+       gint32 profiler_signal_ack;
 } MonoThreadInfo;
 
 typedef struct {
@@ -314,7 +322,7 @@ mono_thread_info_runtime_init (MonoThreadInfoRuntimeCallbacks *callbacks);
 MonoThreadInfoRuntimeCallbacks *
 mono_threads_get_runtime_callbacks (void);
 
-int
+MONO_API int
 mono_thread_info_register_small_id (void);
 
 THREAD_INFO_TYPE *
@@ -341,7 +349,7 @@ mono_thread_info_current (void);
 THREAD_INFO_TYPE*
 mono_thread_info_current_unchecked (void);
 
-int
+MONO_API int
 mono_thread_info_get_small_id (void);
 
 MonoLinkedListSet*