withMVar

withMVar :: MVar a -> (a -> IO b) -> IO b
base Control.Concurrent.MVar
withMVar is a safe wrapper for operating on the contents of an MVar. This operation is exception-safe: it will replace the original contents of the MVar if an exception is raised (see Control.Exception).
withMVar :: MVar a -> (a -> IO b) -> IO b
base GHC.Conc.Sync, base GHC.Conc