Skip to content

Commit 1401a0f

Browse files
committed
deschedule: added a haddock comment.
1 parent 6fe98f4 commit 1401a0f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -826,6 +826,21 @@ threadInterruptible thread =
826826
| otherwise -> False
827827
MaskedUninterruptible -> False
828828

829+
830+
-- | Deschedule a thread.
831+
--
832+
-- A thread is descheduled, which marks a boundary of a `Step` when:
833+
--
834+
-- * forking a new thread
835+
-- * thread termination
836+
-- * setting the masking state to interruptible
837+
-- * popping masking frame (which resets masking state)
838+
-- * starting or cancelling a timeout
839+
-- * thread delays
840+
-- * on committed or blocked, but not aborted STM transactions
841+
-- * on blocking or non-blocking `throwTo`
842+
-- * unhandled exception in a (non-main) thread
843+
--
829844
deschedule :: Deschedule -> Thread s a -> SimState s a -> ST s (SimTrace a)
830845

831846
deschedule Yield thread@Thread { threadId = tid,

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ instance Show ScheduleMod where
176176
-- Steps
177177
--
178178

179+
-- | A unit of execution. `deschedule` marks a boundary of a `Step`, see it's
180+
-- haddocks.
181+
--
179182
data Step = Step {
180183
stepThreadId :: !IOSimThreadId,
181184
stepStep :: !Int,

0 commit comments

Comments
 (0)