File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ module General.Fence(
66
77import Control.Monad
88import Control.Monad.IO.Class
9+ import Control.Exception.Extra
10+ import Development.Shake.Internal.Errors
911import Data.Maybe
1012import Data.Either.Extra
1113import Data.IORef
@@ -21,10 +23,10 @@ instance Show (Fence m a) where show _ = "Fence"
2123newFence :: MonadIO m => IO (Fence m a )
2224newFence = Fence <$> newIORef (Left $ const $ return () )
2325
24- signalFence :: MonadIO m => Fence m a -> a -> m ()
26+ signalFence :: ( Partial , MonadIO m ) => Fence m a -> a -> m ()
2527signalFence (Fence ref) v = join $ liftIO $ atomicModifyIORef' ref $ \ x -> case x of
2628 Left queue -> (Right v, queue v)
27- Right _ -> error " Shake internal error, signalFence called twice on one Fence"
29+ Right _ -> throwImpure $ errorInternal " signalFence called twice on one Fence"
2830
2931waitFence :: MonadIO m => Fence m a -> (a -> m () ) -> m ()
3032waitFence (Fence ref) call = join $ liftIO $ atomicModifyIORef' ref $ \ x -> case x of
You can’t perform that action at this time.
0 commit comments