@@ -75,6 +75,7 @@ module Development.IDE.Core.Shake(
7575 VFSModified (.. ), getClientConfigAction ,
7676 ) where
7777
78+ import Control.Concurrent (withMVar )
7879import Control.Concurrent.Async
7980import Control.Concurrent.STM
8081import Control.Concurrent.STM.Stats (atomicallyNamed )
@@ -724,14 +725,14 @@ shakeSessionInit recorder ide@IdeState{..} = do
724725 logWith recorder Debug LogSessionInitialised
725726
726727shakeShut :: 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
735736
736737
737738-- | This is a variant of withMVar where the first argument is run unmasked and if it throws
0 commit comments