@@ -302,7 +302,7 @@ schedule thread@Thread{
302
302
303
303
ForkFrame -> do
304
304
-- this thread is done
305
- trace <- deschedule Terminated thread simstate
305
+ ! trace <- deschedule Terminated thread simstate
306
306
return $ SimPORTrace time tid tstep tlbl EventThreadFinished
307
307
$ SimPORTrace time tid tstep tlbl (EventDeschedule Terminated )
308
308
$ trace
@@ -312,7 +312,7 @@ schedule thread@Thread{
312
312
let thread' = thread { threadControl = ThreadControl (k x) ctl'
313
313
, threadMasking = maskst' }
314
314
-- but if we're now unmasked, check for any pending async exceptions
315
- trace <- deschedule Interruptable thread' simstate
315
+ ! trace <- deschedule Interruptable thread' simstate
316
316
return $ SimPORTrace time tid tstep tlbl (EventMask maskst')
317
317
$ SimPORTrace time tid tstep tlbl (EventDeschedule Interruptable )
318
318
$ trace
@@ -345,7 +345,7 @@ schedule thread@Thread{
345
345
346
346
| otherwise -> do
347
347
-- An unhandled exception in any other thread terminates the thread
348
- trace <- deschedule Terminated thread simstate
348
+ ! trace <- deschedule Terminated thread simstate
349
349
return $ SimPORTrace time tid tstep tlbl (EventThrow e)
350
350
$ SimPORTrace time tid tstep tlbl (EventThreadUnhandled e)
351
351
$ SimPORTrace time tid tstep tlbl (EventDeschedule Terminated )
@@ -482,7 +482,7 @@ schedule thread@Thread{
482
482
simstate') = unblockThreads vClock wakeup simstate
483
483
modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
484
484
modifySTRef (tvarVClock tvar') (leastUpperBoundVClock vClock)
485
- trace <- deschedule Yield thread' simstate' { timers = timers' }
485
+ ! trace <- deschedule Yield thread' simstate' { timers = timers' }
486
486
return $ SimPORTrace time tid tstep tlbl (EventTimerCancelled tmid)
487
487
$ traceMany
488
488
-- TODO: step
@@ -524,9 +524,9 @@ schedule thread@Thread{
524
524
}
525
525
threads' = Map. insert tid' thread'' threads
526
526
-- A newly forked thread may have a higher priority, so we deschedule this one.
527
- trace <- deschedule Yield thread'
528
- simstate { runqueue = insertThread thread'' runqueue
529
- , threads = threads' }
527
+ ! trace <- deschedule Yield thread'
528
+ simstate { runqueue = insertThread thread'' runqueue
529
+ , threads = threads' }
530
530
return $ SimPORTrace time tid tstep tlbl (EventThreadForked tid')
531
531
$ SimPORTrace time tid tstep tlbl (EventDeschedule Yield )
532
532
$ trace
@@ -553,7 +553,7 @@ schedule thread@Thread{
553
553
written' <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) written
554
554
created' <- traverse (\ (SomeTVar tvar) -> labelledTVarId tvar) created
555
555
-- We deschedule a thread after a transaction... another may have woken up.
556
- trace <- deschedule Yield thread' simstate' { nextVid = nextVid' }
556
+ ! trace <- deschedule Yield thread' simstate' { nextVid = nextVid' }
557
557
return $
558
558
SimPORTrace time tid tstep tlbl (EventTxCommitted written' created' (Just effect')) $
559
559
traceMany
@@ -591,7 +591,7 @@ schedule thread@Thread{
591
591
let effect' = effect <> readEffects read
592
592
thread' = thread { threadVClock = vClock `leastUpperBoundVClock` vClockRead,
593
593
threadEffect = effect' }
594
- trace <- deschedule Blocked thread' simstate
594
+ ! trace <- deschedule Blocked thread' simstate
595
595
return $ SimPORTrace time tid tstep tlbl (EventTxBlocked vids (Just effect'))
596
596
$ SimPORTrace time tid tstep tlbl (EventDeschedule Blocked )
597
597
$ trace
@@ -743,7 +743,7 @@ deschedule Interruptable thread@Thread {
743
743
(unblocked,
744
744
simstate') = unblockThreads vClock [l_labelled tid'] simstate
745
745
-- the thread is stepped when we Yield
746
- trace <- deschedule Yield thread' simstate'
746
+ ! trace <- deschedule Yield thread' simstate'
747
747
return $ SimPORTrace time tid tstep tlbl (EventDeschedule Yield )
748
748
$ SimPORTrace time tid tstep tlbl (EventThrowToUnmasked tid')
749
749
-- TODO: step
@@ -790,7 +790,7 @@ deschedule Terminated thread@Thread { threadId = tid, threadVClock = vClock }
790
790
threads' = Map. insert tid thread' threads
791
791
-- We must keep terminated threads in the state to preserve their vector clocks,
792
792
-- which matters when other threads throwTo them.
793
- trace <- reschedule simstate' { races = threadTerminatesRaces tid $
793
+ ! trace <- reschedule simstate' { races = threadTerminatesRaces tid $
794
794
updateRacesInSimState thread simstate,
795
795
control = advanceControl (threadStepId thread) control,
796
796
threads = threads' }
@@ -874,8 +874,8 @@ reschedule simstate@SimState{ threads, timers, curTime = time, races } =
874
874
simstate') = unblockThreads bottomVClock wakeup simstate
875
875
-- all open races will be completed and reported at this time
876
876
simstate'' = simstate'{ races = noRaces }
877
- trace <- reschedule simstate'' { curTime = time'
878
- , timers = timers' }
877
+ ! trace <- reschedule simstate'' { curTime = time'
878
+ , timers = timers' }
879
879
let traceEntries =
880
880
[ (time', ThreadId [- 1 ], (- 1 ), Just " timer" , EventTimerExpired tmid)
881
881
| tmid <- tmids ]
0 commit comments