1
1
mirror of https://github.com/barrucadu/dejafu.git synced 2024-12-22 21:11:30 +03:00

Merge pull request from gamazeps/cancel

Make cancel blocking
This commit is contained in:
Michael Walker 2017-04-05 20:33:23 +01:00 committed by GitHub
commit dcddfa42a5

View File

@ -292,7 +292,7 @@ waitCatchSTM (Async _ w) = w
-- 'cancel' can of course be obtained by wrapping 'cancel' itself in -- 'cancel' can of course be obtained by wrapping 'cancel' itself in
-- 'async'. -- 'async'.
cancel :: MonadConc m => Async m a -> m () cancel :: MonadConc m => Async m a -> m ()
cancel (Async tid _) = throwTo tid ThreadKilled cancel a@(Async tid _) = throwTo tid ThreadKilled <* waitCatch a
-- | Cancel an asynchronous action by throwing the supplied exception -- | Cancel an asynchronous action by throwing the supplied exception
-- to it. -- to it.