Commit Graph

1412 Commits

Author SHA1 Message Date
Michael Walker
700fb5f1c4 Remove use of . in dejafu-tests (fix for GHC 9.0)
Like the use of `const` in concurrency and dejafu, this doesn't play
nicely with higher ranked types.
2021-03-14 00:11:23 +00:00
Michael Walker
4c98a7f6b7 Remove use of const in dejafu (fix for GHC 9.0) 2021-03-14 00:11:23 +00:00
Michael Walker
349767a7b6 Remove use of const in concurrency (fix for GHC 9.0)
Type inference seems to fall down with the rank-n type of
`forkWithUnmask` + `const`:

    Control/Monad/Conc/Class.hs:525:27: error:
        • Couldn't match type ‘b5’ with ‘forall a. m a -> m a’
          Expected: (forall a. m a -> m a) -> m ()
            Actual: b5 -> m ()
          Cannot instantiate unification variable ‘b5’
          with a type involving polytypes: forall a. m a -> m a
        • In the first argument of ‘forkWithUnmask’, namely ‘(const ma)’
          In the expression: forkWithUnmask (const ma)
          In an equation for ‘fork’: fork ma = forkWithUnmask (const ma)
        • Relevant bindings include
            ma :: m () (bound at Control/Monad/Conc/Class.hs:525:6)
            fork :: m () -> m (ThreadId m)
              (bound at Control/Monad/Conc/Class.hs:525:1)
        |
    525 | fork ma = forkWithUnmask (const ma)
2021-03-14 00:08:18 +00:00
Michael Walker
e64496664e
Merge pull request #333 from barrucadu/dejafu-2401
dejafu-2.4.0.1 release
2020-12-28 01:26:13 +00:00
Michael Walker
fc46e0b5ff dejafu-2.4.0.1 release 2020-12-28 01:04:32 +00:00
Michael Walker
9806335552
Merge pull request #332 from barrucadu/fix-331
Correctly reset new TVar values when restoring snapshots
2020-12-28 01:01:02 +00:00
Michael Walker
86dde99f52 Correctly reset new TVar values when restoring snapshots
This adds the overhead of constructing the effect to every STM
transaction, which I worried would be a large cost; but it turns out
that the overhead is negligible.
2020-12-28 00:04:28 +00:00
Michael Walker
e166641b59 Add a failing test for #331 2020-12-28 00:00:49 +00:00
Michael Walker
3d8f1ff502
Merge pull request #329 from barrucadu/readme-travis
Remove old Travis build indicator from README
2020-12-27 22:31:07 +00:00
Michael Walker
89cfc3363c
Merge pull request #328 from barrucadu/stackage/5795
Support tasty-1.4
2020-12-27 22:30:59 +00:00
Michael Walker
fd74b1ba65 tasty-dejafu-2.0.0.7 release 2020-12-27 22:12:06 +00:00
Michael Walker
cfa86a8baa Make dejafu-tests benchmarks compatible with tasty-1.4
The `opts` param is now passed to `T.foldGroup`, but I don't need it.
2020-12-27 22:12:06 +00:00
Michael Walker
0cc21104ca Bump upper bound of tasty to <1.5
https://github.com/commercialhaskell/stackage/issues/5795
2020-12-27 22:12:06 +00:00
Michael Walker
2dee1cec19 Remove old Travis build indicator from README
We've been using GitHub Actions for a while.
2020-12-27 22:11:59 +00:00
Michael Walker
15c83b933e
Merge pull request #330 from barrucadu/setup-stack
Add workaround for setup-stack incompatibility
2020-12-27 22:11:46 +00:00
Michael Walker
b58439fd1b Add workaround for setup-stack incompatibility
https://github.com/mstksg/setup-stack/issues/13
2020-12-27 21:50:05 +00:00
Michael Walker
d08a7be99f
Merge pull request #325 from barrucadu/fix-324
Fix #324
2020-07-01 00:53:36 +01:00
Michael Walker
9651be88be dejafu-2.4.0.0, hunit-dejafu-2.0.0.4, tasty-dejafu-2.0.0.6 2020-07-01 00:29:37 +01:00
Michael Walker
75eac6693f Remove Bool from Throw/ThrowTo/ThrownSTM actions
If the Maybe MaskingState is Just, then the thread survived; if it's
Nothing the thread was killed.
2020-07-01 00:29:37 +01:00
Michael Walker
9601a78cef Add a ThrownSTM thread action
This is for transactions which throw an exception, rather than
stuffing that information into the `STM` action.  This makes the
traces a bit clearer (eg, you can now tell without needing to inspect
the STM trace if an exception was thrown by a transaction).

I've called this "ThrownSTM" rather than "ThrowSTM" because it's like
"BlockedSTM" (just another failure case), and that's also past tense.
2020-07-01 00:29:37 +01:00
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
Michael Walker
6d74a8977a Add failing tests for #324 2020-07-01 00:29:07 +01:00
Michael Walker
8c4d2e28bc
Merge pull request #326 from barrucadu/random-1.2
random-1.2
2020-06-24 18:15:29 +01:00
Michael Walker
a42851807b tasty-dejafu-2.0.0.5 2020-06-24 17:28:37 +01:00
Michael Walker
297effef37 dejafu-2.3.0.1 2020-06-24 17:28:37 +01:00
Michael Walker
97e0a183ba Correct remaining references to Travis in docs
Spotted this while perusing the Release Process page.
2020-06-24 17:28:37 +01:00
Michael Walker
da8da501bc Relax upper bound on random to <1.3 2020-06-24 17:28:37 +01:00
Michael Walker
57d3c45350
Merge pull request #322 from barrucadu/kill-travis
Remove travis entirely
2020-05-14 20:08:13 +01:00
Michael Walker
fb4383b55a Remove travis entirely
CD is now done with Concourse:
325b5a5b50
2020-05-14 19:49:22 +01:00
Michael Walker
d2afa25506
Merge pull request #321 from barrucadu/github-actions-ci
Use GitHub actions for CI
2020-05-14 15:46:32 +01:00
Michael Walker
85314e4bd7 Use GitHub actions for CI 2020-05-14 15:27:52 +01:00
Michael Walker
72b98f4f9a
Merge pull request #320 from barrucadu/unsafeunmask
Add unsafeUnmask to MonadConc (attempt 2)
2020-05-14 14:37:09 +01:00
Michael Walker
b3eafffc56 hunit-dejafu-2.0.0.3, tasty-dejafu-2.0.0.4 2020-05-14 13:50:12 +01:00
Michael Walker
555f3e682b dejafu-2.3.0.0 2020-05-14 13:50:12 +01:00
Michael Walker
414554d1ef Add unsafeUnmask to dejafu 2020-05-14 13:50:12 +01:00
Michael Walker
cc129ed569 concurrency-1.11.0.0 2020-05-14 13:35:52 +01:00
Michael Walker
bad607e9c3 Add interruptible to Control.Monad.Conc.Class 2020-05-14 13:32:47 +01:00
Mitchell Rosen
f2a9dec759 Add unsafeUnmask to MonadConc 2020-05-14 13:15:02 +01:00
Michael Walker
f3c57ea7f9
Merge pull request #315 from barrucadu/getmaskingstate
Add getMaskingState to concurrency / dejafu
2020-05-10 23:16:45 +01:00
Michael Walker
b20aeb4f85 hunit-dejafu-2.0.0.2, tasty-dejafu-2.0.0.3 2020-05-10 23:05:07 +01:00
Michael Walker
d724e69a9a dejafu-2.2.0.0 2020-05-10 23:05:07 +01:00
Michael Walker
be312a0f46 Add getMaskingState to dejafu 2020-05-10 23:05:07 +01:00
Michael Walker
f930c8c15f concurrency-1.10.0.0 2020-05-10 22:47:47 +01:00
Michael Walker
810fedc034 Add getMaskingState to MonadConc 2020-05-10 22:47:47 +01:00
Michael Walker
104f8bb42c
Merge pull request #313 from barrucadu/tasty-1.3
Bump tasty-dejafu upper bound on tasty to <1.4
2020-05-10 22:47:29 +01:00
Michael Walker
198e3605a7 tasty-dejafu-2.0.0.2 2020-05-10 21:57:05 +01:00
Michael Walker
816bdb9505 Bump tasty upper bound to <1.4 2020-05-10 21:57:05 +01:00
Michael Walker
7a29b6d25e
Merge pull request #314 from barrucadu/lints
Lints
2020-05-10 21:56:52 +01:00
Michael Walker
f21d4ead86 Fix lints 2020-05-10 21:22:30 +01:00
Michael Walker
c2d6bc64a3 Bump default resolver to lts-15.0 2020-05-10 21:02:19 +01:00