Do not include the current thread in trace lists of alternatives

Closes #121
This commit is contained in:
Michael Walker 2017-12-07 02:22:59 +00:00
parent c1046268e8
commit cdbf30dec3
2 changed files with 8 additions and 2 deletions

View File

@ -77,6 +77,10 @@ This project is versioned according to the [Package Versioning Policy](https://p
- If bound threads are supported, the main thread when testing is bound. (#126)
- Each entry in an execution trace is now in the form `(decision, alternatives, action)`. The
chosen thread is no longer in the list of alternatives, which makes raw traces easier to
read. (#121)
### Test.DejaFu.Refinement
- A blocking interference function is no longer reported as a deadlocking execution.

View File

@ -146,8 +146,10 @@ runThreads sched memtype ref = go Seq.empty Nothing where
| (fst <$> prior) `notElem` map (Just . fst) runnable' = Start chosen
| otherwise = SwitchTo chosen
getTrc (Single a) = Seq.singleton (decision, runnable', a)
getTrc (SubC as _) = (decision, runnable', Subconcurrency) <| as
getTrc (Single a) = Seq.singleton (decision, alternatives, a)
getTrc (SubC as _) = (decision, alternatives, Subconcurrency) <| as
alternatives = filter (\(t, _) -> t /= chosen) runnable'
getPrior (Single a) = Just (chosen, a)
getPrior (SubC _ finalD) = finalD