From 9d2e67fcb0ba066dba4803f3998b4ed2c98e1ada Mon Sep 17 00:00:00 2001 From: Yogesh Sajanikar Date: Tue, 2 Aug 2022 23:42:15 +0530 Subject: [PATCH] Add a correct cost center name, and correct the comments. --- io-sim/src/Control/Monad/IOSim/Internal.hs | 12 ++++++------ io-sim/src/Control/Monad/IOSimPOR/Internal.hs | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/io-sim/src/Control/Monad/IOSim/Internal.hs b/io-sim/src/Control/Monad/IOSim/Internal.hs index 76af5e9d..425801ed 100644 --- a/io-sim/src/Control/Monad/IOSim/Internal.hs +++ b/io-sim/src/Control/Monad/IOSim/Internal.hs @@ -892,7 +892,7 @@ execAtomically !time !tid !tlbl !nextVid0 action0 k0 = tvarId tvar `Map.notMember` writtenOuter) writtenSeq ++ writtenOuterSeq - -- Skip the orElse right hand and continue with the k continuation + -- Skip the right hand and continue with the k continuation go ctl' read written' writtenSeq' createdOuterSeq nextVid (k x) ThrowStm e -> @@ -904,16 +904,16 @@ execAtomically !time !tid !tlbl !nextVid0 action0 k0 = k0 $ StmTxAborted [] (toException e) BranchFrame (CatchStmA h) k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> - {-# SCC "execAtomically.go.branchFrame" #-} do - -- Revert all the TVar writes within this orElse + {-# SCC "execAtomically.go.BranchFrame" #-} do + -- Revert all the TVar writes within this catch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written -- Execute the catch handler with an empty written set let ctl'' = BranchFrame EmptyStmA k writtenOuter writtenOuterSeq createdOuterSeq ctl' go ctl'' read Map.empty [] [] nextVid (h e) -- BranchFrame _ _k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> - {-# SCC "execAtomically.go.branchFrame" #-} do - -- Revert all the TVar writes within this orElse + {-# SCC "execAtomically.go.BranchFrame" #-} do + -- Revert all the TVar writes within this branch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written go ctl' read writtenOuter writtenOuterSeq createdOuterSeq nextVid (ThrowStm e) @@ -943,7 +943,7 @@ execAtomically !time !tid !tlbl !nextVid0 action0 k0 = BranchFrame _ _k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> {-# SCC "execAtomically.go.BranchFrame" #-} do - -- Revert all the TVar writes within this orElse branch + -- Revert all the TVar writes within this branch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written -- Skip the continuation and propagate the retry into the outer frame -- using the written set for the outer frame diff --git a/io-sim/src/Control/Monad/IOSimPOR/Internal.hs b/io-sim/src/Control/Monad/IOSimPOR/Internal.hs index 8386014d..d8d5575e 100644 --- a/io-sim/src/Control/Monad/IOSimPOR/Internal.hs +++ b/io-sim/src/Control/Monad/IOSimPOR/Internal.hs @@ -1103,7 +1103,7 @@ execAtomically time tid tlbl nextVid0 action0 k0 = tvarId tvar `Map.notMember` writtenOuter) writtenSeq ++ writtenOuterSeq - -- Skip the orElse right hand and continue with the k continuation + -- Skip the right hand and continue with the k continuation go ctl' read written' writtenSeq' createdOuterSeq nextVid (k x) ThrowStm e -> @@ -1115,16 +1115,16 @@ execAtomically time tid tlbl nextVid0 action0 k0 = k0 $ StmTxAborted [] (toException e) BranchFrame (CatchStmA h) k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> - {-# SCC "execAtomically.go.branchFrame" #-} do - -- Revert all the TVar writes within this orElse + {-# SCC "execAtomically.go.BranchFrame" #-} do + -- Revert all the TVar writes within this catch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written -- Execute the catch handler with an empty written set let ctl'' = BranchFrame EmptyStmA k writtenOuter writtenOuterSeq createdOuterSeq ctl' go ctl'' read Map.empty [] [] nextVid (h e) -- BranchFrame _ _k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> - {-# SCC "execAtomically.go.branchFrame" #-} do - -- Revert all the TVar writes within this orElse + {-# SCC "execAtomically.go.BranchFrame" #-} do + -- Revert all the TVar writes within this branch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written go ctl' read writtenOuter writtenOuterSeq createdOuterSeq nextVid (ThrowStm e) @@ -1153,7 +1153,7 @@ execAtomically time tid tlbl nextVid0 action0 k0 = BranchFrame _ _k writtenOuter writtenOuterSeq createdOuterSeq ctl' -> {-# SCC "execAtomically.go.BranchFrame" #-} do - -- Revert all the TVar writes within this orElse branch + -- Revert all the TVar writes within this branch !_ <- traverse_ (\(SomeTVar tvar) -> revertTVar tvar) written -- Skip the continuation and propagate the retry into the outer frame -- using the written set for the outer frame