Skip to content

Commit 0174780

Browse files
committed
io-sim: strict labels in execNewTVar calls
1 parent 0aca843 commit 0174780

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

io-sim/src/Control/Monad/IOSim/Internal.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ schedule !thread@Thread{
358358
error "schedule: StartTimeout: Impossible happened"
359359

360360
StartTimeout d action' k -> do
361-
!lock <- TMVar <$> execNewTVar nextVid (Just $ "lock-" ++ show nextTmid) Nothing
361+
!lock <- TMVar <$> execNewTVar nextVid (Just $! "lock-" ++ show nextTmid) Nothing
362362
let !expiry = d `addTime` time
363363
!timers' = PSQ.insert nextTmid expiry (TimerTimeout tid nextTmid lock) timers
364364
!thread' = thread { threadControl =
@@ -377,7 +377,7 @@ schedule !thread@Thread{
377377

378378
RegisterDelay d k | d < 0 -> do
379379
!tvar <- execNewTVar nextVid
380-
(Just $ "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
380+
(Just $! "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
381381
True
382382
let !expiry = d `addTime` time
383383
!thread' = thread { threadControl = ThreadControl (k tvar) ctl }
@@ -388,7 +388,7 @@ schedule !thread@Thread{
388388

389389
RegisterDelay d k -> do
390390
!tvar <- execNewTVar nextVid
391-
(Just $ "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
391+
(Just $! "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
392392
False
393393
let !expiry = d `addTime` time
394394
!timers' = PSQ.insert nextTmid expiry (TimerRegisterDelay tvar) timers
@@ -430,7 +430,7 @@ schedule !thread@Thread{
430430

431431
NewTimeout d k -> do
432432
!tvar <- execNewTVar nextVid
433-
(Just $ "<<timeout-state " ++ show (unTimeoutId nextTmid) ++ ">>")
433+
(Just $! "<<timeout-state " ++ show (unTimeoutId nextTmid) ++ ">>")
434434
TimeoutPending
435435
let !expiry = d `addTime` time
436436
!t = Timeout tvar nextTmid

io-sim/src/Control/Monad/IOSimPOR/Internal.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ schedule thread@Thread{
482482
error "schedule: StartTimeout: Impossible happened"
483483

484484
StartTimeout d action' k -> do
485-
lock <- TMVar <$> execNewTVar nextVid (Just $ "lock-" ++ show nextTmid) Nothing
485+
lock <- TMVar <$> execNewTVar nextVid (Just $! "lock-" ++ show nextTmid) Nothing
486486
let expiry = d `addTime` time
487487
timers' = PSQ.insert nextTmid expiry (TimerTimeout tid nextTmid lock) timers
488488
thread' = thread { threadControl =
@@ -499,7 +499,7 @@ schedule thread@Thread{
499499

500500
RegisterDelay d k | d < 0 -> do
501501
tvar <- execNewTVar nextVid
502-
(Just $ "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
502+
(Just $! "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
503503
True
504504
modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
505505
let !expiry = d `addTime` time
@@ -511,7 +511,7 @@ schedule thread@Thread{
511511

512512
RegisterDelay d k -> do
513513
tvar <- execNewTVar nextVid
514-
(Just $ "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
514+
(Just $! "<<timeout " ++ show (unTimeoutId nextTmid) ++ ">>")
515515
False
516516
modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
517517
let !expiry = d `addTime` time
@@ -555,7 +555,7 @@ schedule thread@Thread{
555555

556556
NewTimeout d k -> do
557557
tvar <- execNewTVar nextVid
558-
(Just $ "<<timeout-state " ++ show (unTimeoutId nextTmid) ++ ">>")
558+
(Just $! "<<timeout-state " ++ show (unTimeoutId nextTmid) ++ ">>")
559559
TimeoutPending
560560
modifySTRef (tvarVClock tvar) (leastUpperBoundVClock vClock)
561561
let expiry = d `addTime` time

0 commit comments

Comments
 (0)