File tree 4 files changed +8
-9
lines changed
session-loader/Development/IDE
4 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -105,7 +105,7 @@ import Data.HashSet (HashSet)
105
105
import qualified Data.HashSet as Set
106
106
import Database.SQLite.Simple
107
107
import Development.IDE.Core.Tracing (withTrace )
108
- import Development.IDE.Core.WorkerThread (blockRunInThread ,
108
+ import Development.IDE.Core.WorkerThread (awaitRunInThread ,
109
109
withWorkerQueue )
110
110
import Development.IDE.Session.Diagnostics (renderCradleError )
111
111
import Development.IDE.Types.Shake (WithHieDb ,
@@ -737,7 +737,7 @@ loadSessionWithOptions recorder SessionLoadingOptions{..} rootDir que = do
737
737
738
738
returnWithVersion $ \ file -> do
739
739
-- see Note [Serializing runs in separate thread]
740
- blockRunInThread que $ getOptions file
740
+ awaitRunInThread que $ getOptions file
741
741
742
742
-- | Run the specific cradle on a specific FilePath via hie-bios.
743
743
-- This then builds dependencies or whatever based on the cradle, gets the
Original file line number Diff line number Diff line change @@ -806,7 +806,7 @@ delayedAction a = do
806
806
-- but actions added via 'shakeEnqueue' will be requeued.
807
807
shakeRestart :: Recorder (WithPriority Log ) -> IdeState -> VFSModified -> String -> [DelayedAction () ] -> IO [Key ] -> IO ()
808
808
shakeRestart recorder IdeState {.. } vfs reason acts ioActionBetweenShakeSession =
809
- void $ blockRunInThread (restartQueue shakeExtras) $ do
809
+ void $ awaitRunInThread (restartQueue shakeExtras) $ do
810
810
withMVar'
811
811
shakeSession
812
812
(\ runner -> do
Original file line number Diff line number Diff line change 1
1
module Development.IDE.Core.WorkerThread
2
- (withWorkerQueue , blockRunInThread )
2
+ (withWorkerQueue , awaitRunInThread )
3
3
where
4
4
5
5
import Control.Concurrent.Async
@@ -20,7 +20,7 @@ import Control.Monad.Cont (ContT (ContT))
20
20
--
21
21
-- `Development.IDE.Core.WorkerThread` module provides a simple api to implement this easily.
22
22
-- * `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.
24
24
25
25
26
26
-- | withWorkerQueue creates a new TQueue and runs the workerAction in a separate thread.
@@ -34,9 +34,9 @@ withWorkerQueue workerAction = ContT $ \mainAction -> do
34
34
l <- atomically $ readTQueue q
35
35
workerAction l
36
36
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
40
40
-- Take an action from TQueue, run it and
41
41
-- use barrier to wait for the result
42
42
barrier <- newBarrier
Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ import Control.Monad.IO.Class (liftIO)
24
24
import qualified Data.Aeson as J
25
25
import Data.Coerce (coerce )
26
26
import Data.Default (Default (def ))
27
- import Data.Foldable (traverse_ )
28
27
import Data.Hashable (hashed )
29
28
import qualified Data.HashMap.Strict as HashMap
30
29
import Data.List.Extra (intercalate ,
You can’t perform that action at this time.
0 commit comments