on master help sign in
cleanup any pending threads on exception
commitdc7f419bb2d852383e6c7e019a637649d18abb1d authorHarendra Kumar <harendra.kumar@gmail.com> dateWed 24 Oct 2018, 11:18 (8 years ago) parente810658
2 files changed+2−1
Changelog.md+1 src/Streamly/Streams/SVar.hs+1−1
Changelog.md+1
@@ -2,6 +2,7 @@
22
33### Bug Fixes
44
5+* Cleanup any pending threads when an exception occurs.
56* Fixed a livelock in ahead style streams. The problem manifests sometimes when
67 multiple streams are merged together in ahead style and one of them is a nil
78 stream.
src/Streamly/Streams/SVar.hs+1−1
@@ -101,7 +101,7 @@ fromStreamVar sv = Stream $ \st stp sng yld -> do
101101 case fromException ex of
102102 Just ThreadAbort ->
103103 unStream rest (rstState st) stp sng yld
104− Nothing -> throwM ex
104+ Nothing -> liftIO (cleanupSVar sv) >> throwM ex
105105
106106{-# INLINE fromSVar #-}
107107fromSVar :: (MonadAsync m, IsStream t) => SVar Stream m a -> t m a