[threadpool-ms] Fix potential bug on monitor thread interuption
authorLudovic Henry <ludovic.henry@xamarin.com>
Thu, 7 May 2015 16:27:55 +0000 (17:27 +0100)
committerLudovic Henry <ludovic.henry@xamarin.com>
Fri, 8 May 2015 12:28:26 +0000 (13:28 +0100)
mono/metadata/threadpool-ms.c

index 38265909e3cb6d1520fadd8863bb0baf53f48d25..bc3822ace4d3a8e0373d83e9eb8a5eb6f271c096 100644 (file)
@@ -826,8 +826,10 @@ monitor_thread (void)
                                break;
                        interval_left -= mono_msec_ticks () - ts;
 
+                       mono_gc_set_skip_thread (FALSE);
                        if ((current_thread->state & (ThreadState_StopRequested | ThreadState_SuspendRequested)) != 0)
                                mono_thread_interruption_checkpoint ();
+                       mono_gc_set_skip_thread (TRUE);
                } while (interval_left > 0 && ++awake < 10);
 
                mono_gc_set_skip_thread (FALSE);