mirror of
https://github.com/barrucadu/dejafu.git
synced 2024-11-27 04:36:57 +03:00
601c4c8690
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. |
||
---|---|---|
.. | ||
Examples | ||
Integration | ||
Test/Tasty | ||
Unit | ||
Common.hs | ||
Examples.hs | ||
Integration.hs | ||
QSemN.hs | ||
Unit.hs |