dejafu/dejafu-tests/lib
Michael Walker 601c4c8690 Atomically update masking state on jumping to an exc. handler
In this excerpt:

    uninterruptibleMask $ \restore -> fork $ do
      result <- try (restore (throw ThreadKilled))
      ...

The `throw` jumps to an exception handler registered outside the
`restore`, which means there is a masking state change.  Previously,
dejafu handled this by inserting an `AResetMask` action as the first
action of the handler; but this is incorrect, as it opens a potential
race condition with another thread calling `throwTo`.  As `throw` (and
`throwTo`, and an uncaught `throwSTM`) "use up" the exception handler,
this is not a benign race: the thread will be killed!

The solution is to atomically restore the masking state.

This commit implements that, and changes `Throw`, `ThrowTo`, and `STM`
to include the new masking state (if it changed).  I think this is a
bit confusing, so I'll make a follow-up commit to split out a new
`ThrownSTM` action.
2020-07-01 00:29:36 +01:00
..
Examples Fix new lints 2020-02-20 22:54:12 +00:00
Integration Atomically update masking state on jumping to an exc. handler 2020-07-01 00:29:36 +01:00
Test/Tasty Get dejafu-tests building with hedgehog-1.0.2 2020-02-20 22:13:48 +00:00
Unit Atomically update masking state on jumping to an exc. handler 2020-07-01 00:29:36 +01:00
Common.hs Use the post-withSetup DepState 2019-02-12 22:20:34 +00:00
Examples.hs Replace QuickCheck tests with Hedgehog ones 2018-02-16 20:04:54 +00:00
Integration.hs Add some tests for MonadDejaFu IO & ST 2019-03-24 02:29:43 +00:00
QSemN.hs Fix GHC 8.8 test compilation failures 2019-10-04 18:21:50 +01:00
Unit.hs Add predicate unit tests 2018-06-10 22:30:02 +01:00