Record the result in IsCurrentThreadBound

This commit is contained in:
Michael Walker 2017-12-11 15:55:40 +00:00
parent a3954f3179
commit ade267c166
3 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ stepThread sched memtype tid action ctx = case action of
-- check if the current thread is bound
AIsBound c ->
let isBound = isJust (_bound =<< M.lookup tid (cThreads ctx))
in simple (goto (c isBound) tid (cThreads ctx)) IsCurrentThreadBound
in simple (goto (c isBound) tid (cThreads ctx)) (IsCurrentThreadBound isBound)
-- get the 'ThreadId' of the current thread
AMyTId c -> simple (goto (c tid) tid (cThreads ctx)) MyThreadId

View File

@ -127,7 +127,7 @@ tvarsRead act = S.fromList $ case act of
rewind :: ThreadAction -> Maybe Lookahead
rewind (Fork _) = Just WillFork
rewind (ForkOS _) = Just WillForkOS
rewind IsCurrentThreadBound = Just WillIsCurrentThreadBound
rewind (IsCurrentThreadBound _) = Just WillIsCurrentThreadBound
rewind MyThreadId = Just WillMyThreadId
rewind (GetNumCapabilities _) = Just WillGetNumCapabilities
rewind (SetNumCapabilities i) = Just (WillSetNumCapabilities i)

View File

@ -91,7 +91,7 @@ data ThreadAction =
-- ^ Start a new thread.
| ForkOS ThreadId
-- ^ Start a new bound thread.
| IsCurrentThreadBound
| IsCurrentThreadBound Bool
-- ^ Check if the current thread is bound.
| MyThreadId
-- ^ Get the 'ThreadId' of the current thread.