Skip to content

Commit 6bdba37

Browse files
committed
merge
2 parents c832da3 + c1b3e7d commit 6bdba37

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Moreover, we can not stop these threads uniformly when we are shutting down the
2424
* `awaitRunInThread` : accepts a `TQueue` and an action to run in separate thread and waits for the result.
2525
-}
2626

27-
-- | withWorkerQueue creates a new TQueue and runs the workerAction in a separate thread.
27+
-- | 'withWorkerQueue' creates a new 'TQueue', and launches a worker
28+
-- thread which polls the queue for requests and runs the given worker
29+
-- function on them.
2830
withWorkerQueue :: (t -> IO a) -> ContT () IO (TQueue t)
2931
withWorkerQueue workerAction = ContT $ \mainAction -> do
3032
q <- newTQueueIO
@@ -35,7 +37,8 @@ withWorkerQueue workerAction = ContT $ \mainAction -> do
3537
l <- atomically $ readTQueue q
3638
workerAction l
3739

38-
-- | awaitRunInThread run and wait for the result
40+
-- | 'awaitRunInThread' queues up an 'IO' action to be run by a worker thread,
41+
-- and then blocks until the result is computed.
3942
awaitRunInThread :: TQueue (IO ()) -> IO result -> IO result
4043
awaitRunInThread q act = do
4144
-- Take an action from TQueue, run it and

0 commit comments

Comments
 (0)