@@ -75,6 +75,7 @@ module Development.IDE.Core.Shake(
75
75
VFSModified (.. ), getClientConfigAction ,
76
76
) where
77
77
78
+ import Control.Concurrent (withMVar )
78
79
import Control.Concurrent.Async
79
80
import Control.Concurrent.STM
80
81
import Control.Concurrent.STM.Stats (atomicallyNamed )
@@ -724,14 +725,14 @@ shakeSessionInit recorder ide@IdeState{..} = do
724
725
logWith recorder Debug LogSessionInitialised
725
726
726
727
shakeShut :: IdeState -> IO ()
727
- shakeShut IdeState {.. } = do
728
- runner <- tryReadMVar shakeSession
729
- -- Shake gets unhappy if you try to close when there is a running
730
- -- request so we first abort that.
731
- for_ runner cancelShakeSession
732
- void $ shakeDatabaseProfile shakeDb
733
- progressStop $ progress shakeExtras
734
- stopMonitoring
728
+ shakeShut IdeState {.. } =
729
+ withMVar shakeSession $ \ runner -> do
730
+ -- Shake gets unhappy if you try to close when there is a running
731
+ -- request so we first abort that.
732
+ cancelShakeSession runner
733
+ void $ shakeDatabaseProfile shakeDb
734
+ progressStop $ progress shakeExtras
735
+ stopMonitoring
735
736
736
737
737
738
-- | This is a variant of withMVar where the first argument is run unmasked and if it throws
0 commit comments