GHC 7.6 Support
lifted-base no longer contains addMVarFinalizer
This commit is contained in:
parent
bbe6138fea
commit
ed0c264a35
2 changed files with 4 additions and 4 deletions
|
@ -47,7 +47,7 @@ import Data.Int (Int32)
|
|||
import Data.Maybe (listToMaybe, catMaybes)
|
||||
import Data.Word (Word32)
|
||||
|
||||
import Control.Concurrent.MVar.Lifted (MVar, newMVar, addMVarFinalizer,
|
||||
import Control.Concurrent.MVar.Lifted (MVar, newMVar, mkWeakMVar,
|
||||
readMVar, modifyMVar)
|
||||
import Control.Monad.Base (MonadBase(liftBase))
|
||||
import Control.Monad.Error (ErrorT, Error(..), MonadError, runErrorT,
|
||||
|
@ -509,7 +509,7 @@ newCursor :: (MonadIO m, MonadBaseControl IO m) => Database -> Collection -> Bat
|
|||
newCursor db col batchSize dBatch = do
|
||||
var <- newMVar dBatch
|
||||
let cursor = Cursor (db <.> col) batchSize var
|
||||
addMVarFinalizer var (closeCursor cursor)
|
||||
mkWeakMVar var (closeCursor cursor)
|
||||
return cursor
|
||||
|
||||
nextBatch :: (MonadIO m, MonadBaseControl IO m) => Cursor -> Action m [Document]
|
||||
|
|
|
@ -20,7 +20,7 @@ import GHC.Conc (ThreadStatus(..), threadStatus)
|
|||
|
||||
import Control.Monad.Trans (liftIO)
|
||||
import Control.Concurrent.MVar.Lifted (MVar, newEmptyMVar, newMVar, withMVar,
|
||||
putMVar, readMVar, addMVarFinalizer)
|
||||
putMVar, readMVar, mkWeakMVar)
|
||||
import Control.Monad.Error (ErrorT(ErrorT), runErrorT)
|
||||
|
||||
onException :: (Monad m) => ErrorT e m a -> m () -> ErrorT e m a
|
||||
|
@ -58,7 +58,7 @@ newPipeline stream = do
|
|||
rec
|
||||
let pipe = Pipeline{..}
|
||||
listenThread <- forkIO (listen pipe)
|
||||
addMVarFinalizer vStream $ do
|
||||
mkWeakMVar vStream $ do
|
||||
killThread listenThread
|
||||
closeStream stream
|
||||
return pipe
|
||||
|
|
Loading…
Reference in a new issue