Merge pull request #1624 from esdrubal/getprocesstimes
[mono.git] / mono / metadata / monitor.c
index 5cb4400b5cfb59f6af266200c2c5c837927f00e4..f75606c501039317808607c7bdfaccbfe8930a97 100644 (file)
@@ -662,7 +662,9 @@ retry_contended:
         * We pass TRUE instead of allow_interruption since we have to check for the
         * StopRequested case below.
         */
+       MONO_PREPARE_BLOCKING
        ret = WaitForSingleObjectEx (mon->entry_sem, waitms, TRUE);
+       MONO_FINISH_BLOCKING
 
        mono_thread_clr_state (thread, ThreadState_WaitSleepJoin);
        
@@ -1086,7 +1088,9 @@ ves_icall_System_Threading_Monitor_Monitor_wait (MonoObject *obj, guint32 ms)
         * is private to this thread.  Therefore even if the event was
         * signalled before we wait, we still succeed.
         */
+       MONO_PREPARE_BLOCKING
        ret = WaitForSingleObjectEx (event, ms, TRUE);
+       MONO_FINISH_BLOCKING
 
        /* Reset the thread state fairly early, so we don't have to worry
         * about the monitor error checking