[coop] Do not pass current thread to mono_threads_enter_gc_unsafe_region_cookie
authorLudovic Henry <ludovic@xamarin.com>
Mon, 30 May 2016 18:11:35 +0000 (20:11 +0200)
committerLudovic Henry <ludovic@xamarin.com>
Thu, 2 Jun 2016 21:25:31 +0000 (23:25 +0200)
mono/metadata/threads.c
mono/utils/mono-threads-coop.c
mono/utils/mono-threads.h

index 36a62381536d61cfcca1573fd8a92914ef3630f0..88dfede76a31774585a21326ce7d4cc05c778d1c 100644 (file)
@@ -5125,7 +5125,7 @@ mono_threads_attach_coop (MonoDomain *domain, gpointer *dummy)
                *dummy = NULL;
                /* mono_thread_attach put the thread in RUNNING mode from STARTING, but we need to
                 * return the right cookie. */
-               return mono_threads_enter_gc_unsafe_region_cookie (mono_thread_info_current ());
+               return mono_threads_enter_gc_unsafe_region_cookie ();
        } else {
                *dummy = orig;
                /* thread state (BLOCKING|RUNNING) -> RUNNING */
index ec6f6ab4658b646e4132722456432f073f3a8c00..78ff1c45d7075b7e8ae584af1230c422702d889a 100644 (file)
@@ -341,10 +341,16 @@ mono_threads_enter_gc_unsafe_region_unbalanced_with_info (MonoThreadInfo *info,
 }
 
 gpointer
-mono_threads_enter_gc_unsafe_region_cookie (MonoThreadInfo *info)
+mono_threads_enter_gc_unsafe_region_cookie (void)
 {
+       MonoThreadInfo *info;
+
        g_assert (mono_threads_is_coop_enabled ());
 
+       info = mono_thread_info_current_unchecked ();
+
+       check_info (info, "enter (cookie)", "unsafe");
+
 #ifdef ENABLE_CHECKED_BUILD_GC
        if (mono_check_mode_enabled (MONO_CHECK_MODE_GC))
                coop_tls_push (info);
index 3d3c5d5c47ba4adbe08e10655a40b25da4803df9..da88f34e35b6ae32d1fc30bdfacf06d1406d5709 100644 (file)
@@ -605,7 +605,7 @@ MonoAbortBlockingResult mono_threads_transition_abort_blocking (THREAD_INFO_TYPE
 MonoThreadUnwindState* mono_thread_info_get_suspend_state (THREAD_INFO_TYPE *info);
 
 gpointer
-mono_threads_enter_gc_unsafe_region_cookie (THREAD_INFO_TYPE *info);
+mono_threads_enter_gc_unsafe_region_cookie (void);
 
 
 void mono_thread_info_wait_for_resume (THREAD_INFO_TYPE *info);