Skip to content

Commit a16d04a

Browse files
committed
rename to await
1 parent 027e5be commit a16d04a

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

ghcide/session-loader/Development/IDE/Session.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ import Data.HashSet (HashSet)
105105
import qualified Data.HashSet as Set
106106
import Database.SQLite.Simple
107107
import Development.IDE.Core.Tracing (withTrace)
108-
import Development.IDE.Core.WorkerThread (blockRunInThread,
108+
import Development.IDE.Core.WorkerThread (awaitRunInThread,
109109
withWorkerQueue)
110110
import Development.IDE.Session.Diagnostics (renderCradleError)
111111
import Development.IDE.Types.Shake (WithHieDb,
@@ -737,7 +737,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
737737

738738
returnWithVersion $ \file -> do
739739
-- see Note [Serializing runs in separate thread]
740-
blockRunInThread que $ getOptions file
740+
awaitRunInThread que $ getOptions file
741741

742742
-- | Run the specific cradle on a specific FilePath via hie-bios.
743743
-- This then builds dependencies or whatever based on the cradle, gets the

ghcide/src/Development/IDE/Core/Shake.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ delayedAction a = do
806806
-- but actions added via 'shakeEnqueue' will be requeued.
807807
shakeRestart :: Recorder (WithPriority Log) -> IdeState -> VFSModified -> String -> [DelayedAction ()] -> IO [Key] -> IO ()
808808
shakeRestart recorder IdeState{..} vfs reason acts ioActionBetweenShakeSession =
809-
void $ blockRunInThread (restartQueue shakeExtras) $ do
809+
void $ awaitRunInThread (restartQueue shakeExtras) $ do
810810
withMVar'
811811
shakeSession
812812
(\runner -> do

ghcide/src/Development/IDE/Core/WorkerThread.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module Development.IDE.Core.WorkerThread
2-
(withWorkerQueue, blockRunInThread)
2+
(withWorkerQueue, awaitRunInThread)
33
where
44

55
import Control.Concurrent.Async
@@ -20,7 +20,7 @@ import Control.Monad.Cont (ContT (ContT))
2020
--
2121
-- `Development.IDE.Core.WorkerThread` module provides a simple api to implement this easily.
2222
-- * `withWorkerQueue`: accepts an action to run in separate thread and returns a `TQueue` to send the actions to run.
23-
-- * `blockRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.
23+
-- * `awaitRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.
2424

2525

2626
-- | withWorkerQueue creates a new TQueue and runs the workerAction in a separate thread.
@@ -34,9 +34,9 @@ withWorkerQueue workerAction = ContT $ \mainAction -> do
3434
l <- atomically $ readTQueue q
3535
workerAction l
3636

37-
-- | blockRunInThread run and wait for the result
38-
blockRunInThread :: TQueue (IO ()) -> IO result -> IO result
39-
blockRunInThread q act = do
37+
-- | awaitRunInThread run and wait for the result
38+
awaitRunInThread :: TQueue (IO ()) -> IO result -> IO result
39+
awaitRunInThread q act = do
4040
-- Take an action from TQueue, run it and
4141
-- use barrier to wait for the result
4242
barrier <- newBarrier

ghcide/src/Development/IDE/Main.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import Control.Monad.IO.Class (liftIO)
2424
import qualified Data.Aeson as J
2525
import Data.Coerce (coerce)
2626
import Data.Default (Default (def))
27-
import Data.Foldable (traverse_)
2827
import Data.Hashable (hashed)
2928
import qualified Data.HashMap.Strict as HashMap
3029
import Data.List.Extra (intercalate,

0 commit comments

Comments
 (0)