From 013650b8dcfb810e3e1fdb7d0000929bed646153 Mon Sep 17 00:00:00 2001 From: Patrick Date: Tue, 7 May 2024 03:09:12 +0800 Subject: [PATCH] wait for cancel --- ghcide/src/Development/IDE/Core/Shake.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index 05ab86cbcb..a112923fe9 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -77,6 +77,7 @@ module Development.IDE.Core.Shake( ) where import Control.Concurrent.Async +import Control.Concurrent.Extra (signalBarrier) import Control.Concurrent.STM import Control.Concurrent.STM (writeTQueue) import Control.Concurrent.STM.Stats (atomicallyNamed) @@ -174,7 +175,6 @@ import qualified StmContainers.Map as STM import System.FilePath hiding (makeRelative) import System.IO.Unsafe (unsafePerformIO) import System.Time.Extra -import Control.Concurrent.Extra (signalBarrier) -- See Note [Guidelines For Using CPP In GHCIDE Import Statements] #if !MIN_VERSION_ghc(9,3,0) @@ -766,8 +766,8 @@ shakeRestart recorder IdeState{..} vfs reason acts ioActionBetweenShakeSession = withMVar' shakeSession (\runner -> do - signalBarrier barrier () (stopTime,()) <- duration $ logErrorAfter 10 $ cancelShakeSession runner + signalBarrier barrier () keys <- ioActionBetweenShakeSession atomically $ modifyTVar' (dirtyKeys shakeExtras) $ \x -> foldl' (flip insertKeySet) x keys res <- shakeDatabaseProfile shakeDb