Merge pull request #618 from knocte/aspnet_lru
[mono.git] / mono / utils / mono-threads.h
index a9160c9a25a68be06b5135c3125c3e808334ded3..b30e9ac4c16716c201ce2cb1bf853b177014cadc 100644 (file)
@@ -13,9 +13,7 @@
 #include <mono/utils/mono-semaphore.h>
 #include <mono/utils/mono-stack-unwinding.h>
 #include <mono/utils/mono-linked-list-set.h>
-
-/* FIXME used for CRITICAL_SECTION replace with mono-mutex  */
-#include <mono/io-layer/io-layer.h>
+#include <mono/utils/mono-mutex.h>
 
 #include <glib.h>
 
@@ -98,8 +96,11 @@ typedef struct {
        MonoNativeThreadHandle native_handle; /* Valid on mach and android */
        int thread_state;
 
+       /*Tells if this thread was created by the runtime or not.*/
+       gboolean runtime_thread;
+
        /* suspend machinery, fields protected by the suspend_lock */
-       CRITICAL_SECTION suspend_lock;
+       mono_mutex_t suspend_lock;
        int suspend_count;
 
        MonoSemType finish_resume_semaphore;
@@ -109,6 +110,7 @@ typedef struct {
 #if (defined(_POSIX_VERSION) || defined(__native_client__)) && !defined (__MACH__)
        MonoSemType suspend_semaphore;
        gboolean syscall_break_signal;
+       gboolean suspend_can_continue;
 #endif
 
        /*In theory, only the posix backend needs this, but having it on mach/win32 simplifies things a lot.*/
@@ -142,13 +144,13 @@ typedef struct {
 /*
 Requires the world to be stoped
 */
-#define FOREACH_THREAD(thread) MONO_LLS_FOREACH (mono_thread_info_list_head (), thread)
+#define FOREACH_THREAD(thread) MONO_LLS_FOREACH (mono_thread_info_list_head (), thread, SgenThreadInfo*)
 #define END_FOREACH_THREAD MONO_LLS_END_FOREACH
 
 /*
 Snapshot iteration.
 */
-#define FOREACH_THREAD_SAFE(thread) MONO_LLS_FOREACH_SAFE (mono_thread_info_list_head (), thread)
+#define FOREACH_THREAD_SAFE(thread) MONO_LLS_FOREACH_SAFE (mono_thread_info_list_head (), thread, SgenThreadInfo*)
 #define END_FOREACH_THREAD_SAFE MONO_LLS_END_FOREACH_SAFE
 
 #define mono_thread_info_get_tid(info) ((MonoNativeThreadId)((MonoThreadInfo*)info)->node.key)