Commit c435fef8 authored by simonmar's avatar simonmar
Browse files

[project @ 2005-02-15 11:39:52 by simonmar]

remove race conditions in the recent in_haskell sanity check code
parent ec1c2c02
...@@ -1600,10 +1600,10 @@ suspendThread( StgRegTable *reg ) ...@@ -1600,10 +1600,10 @@ suspendThread( StgRegTable *reg )
IF_DEBUG(scheduler, sched_belch("worker (token %d): leaving RTS", tok)); IF_DEBUG(scheduler, sched_belch("worker (token %d): leaving RTS", tok));
#endif #endif
in_haskell = rtsFalse;
RELEASE_LOCK(&sched_mutex); RELEASE_LOCK(&sched_mutex);
errno = saved_errno; errno = saved_errno;
in_haskell = rtsFalse;
return tok; return tok;
} }
...@@ -1648,9 +1648,9 @@ resumeThread( StgInt tok ) ...@@ -1648,9 +1648,9 @@ resumeThread( StgInt tok )
tso->why_blocked = NotBlocked; tso->why_blocked = NotBlocked;
cap->r.rCurrentTSO = tso; cap->r.rCurrentTSO = tso;
in_haskell = rtsTrue;
RELEASE_LOCK(&sched_mutex); RELEASE_LOCK(&sched_mutex);
errno = saved_errno; errno = saved_errno;
in_haskell = rtsTrue;
return &cap->r; return &cap->r;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment