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

Use ActionRegistry instead of TempRegistry everywhere #510

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
11 changes: 4 additions & 7 deletions lsm-tree.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -846,16 +846,13 @@ library control
Control.ActionRegistry
Control.Concurrent.Class.MonadSTM.RWVar
Control.RefCount
Control.TempRegistry

build-depends:
, base >=4.14 && <4.22
, containers ^>=0.6 || ^>=0.7
, deepseq ^>=1.4 || ^>=1.5
, io-classes ^>=1.6 || ^>=1.7
, io-classes:strict-mvar
, base >=4.14 && <4.22
, deepseq ^>=1.4 || ^>=1.5
, io-classes ^>=1.6 || ^>=1.7
, io-classes:strict-stm
, primitive ^>=0.9
, primitive ^>=0.9

test-suite control-test
import: language, warnings
Expand Down
6 changes: 2 additions & 4 deletions src-control/Control/ActionRegistry.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ import Data.List.NonEmpty (NonEmpty (..))
import qualified Data.List.NonEmpty as NE
import Data.Primitive.MutVar

-- TODO: replace TempRegistry by ActionRegistry

-- TODO: add tests using fs-sim/io-sim to make sure exception safety is
-- guaranteed.

Expand Down Expand Up @@ -249,8 +247,8 @@ unsafeFinaliseActionRegistry reg ec = case ec of
unsafeCommitActionRegistry :: (PrimMonad m, MonadCatch m) => ActionRegistry m -> m ()
unsafeCommitActionRegistry reg = do
as <- readMutVar (registryDelay reg)
-- Run actions in LIFO order
r <- runActions as
-- Run actions in FIFO order
r <- runActions (reverse as)
case NE.nonEmpty r of
Nothing -> pure ()
Just exceptions -> throwIO (CommitActionRegistryError exceptions)
Expand Down
226 changes: 0 additions & 226 deletions src-control/Control/TempRegistry.hs

This file was deleted.

Loading
Loading