Fix for interruptible FFI handling
[ghc-hetmet.git] / rts / Schedule.c
index 456258c..f6a9ef2 100644 (file)
@@ -1817,6 +1817,9 @@ resumeThread (void *task_)
 
     traceEventRunThread(cap, tso);
     
+    /* Reset blocking status */
+    tso->why_blocked  = NotBlocked;
+
     if ((tso->flags & TSO_BLOCKEX) == 0) {
         // avoid locking the TSO if we don't have to
         if (tso->blocked_exceptions != END_BLOCKED_EXCEPTIONS_QUEUE) {
@@ -1824,9 +1827,6 @@ resumeThread (void *task_)
         }
     }
     
-    /* Reset blocking status */
-    tso->why_blocked  = NotBlocked;
-    
     cap->r.rCurrentTSO = tso;
     cap->in_haskell = rtsTrue;
     errno = saved_errno;