Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deschedule: added a haddock comment. #184

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions io-sim/src/Control/Monad/IOSimPOR/Internal.hs
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,21 @@ threadInterruptible thread =
| otherwise -> False
MaskedUninterruptible -> False


-- | Deschedule a thread.
--
-- A thread is descheduled, which marks a boundary of a `Step` when:
--
-- * forking a new thread
-- * thread termination
-- * setting the masking state to interruptible
-- * popping masking frame (which resets masking state)
-- * starting or cancelling a timeout
-- * thread delays
-- * on committed or blocked, but not aborted STM transactions
-- * on blocking or non-blocking `throwTo`
-- * unhandled exception in a (non-main) thread
--
deschedule :: Deschedule -> Thread s a -> SimState s a -> ST s (SimTrace a)

deschedule Yield thread@Thread { threadId = tid,
Expand Down
3 changes: 3 additions & 0 deletions io-sim/src/Control/Monad/IOSimPOR/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ instance Show ScheduleMod where
-- Steps
--

-- | A unit of execution. `deschedule` marks a boundary of a `Step`, see it's
-- haddocks.
--
data Step = Step {
stepThreadId :: !IOSimThreadId,
stepStep :: !Int,
Expand Down
Loading