File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
hls-graph/src/Development/IDE/Graph/Internal Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ import Control.Concurrent.Extra
1717import Control.Concurrent.STM.Stats (STM , atomically ,
1818 atomicallyNamed ,
1919 modifyTVar' , newTVarIO ,
20- readTMVar , readTVarIO )
20+ putTMVar , readTMVar ,
21+ readTVarIO )
2122import Control.Exception
2223import Control.Monad
2324import Control.Monad.IO.Class (MonadIO (liftIO ))
@@ -119,12 +120,16 @@ builderOne ba db@Database {..} stack id = UE.mask $ \restore -> do
119120 status <- SMap. lookup id databaseValues
120121 val <-
121122 let refreshRsult s = do
122- let act = restore $ case ba of
123+ let putResult act = do
124+ res <- act
125+ liftIO $ atomically $ putTMVar barrier res
126+ return res
127+ let act = restore $ (case ba of
123128 BuildNary ->
124129 asyncWithCleanUp $
125- refresh db stack id s
130+ putResult $ refresh db stack id s
131+ BuildUnary -> fmap return $ putResult $ refresh db stack id s)
126132 `UE.onException` (UE. uninterruptibleMask_ $ liftIO (atomicallyNamed " builder - onException" (SMap. focus updateDirty id databaseValues)))
127- BuildUnary -> fmap return $ refresh db stack id s
128133 -- Mark the key as running
129134 SMap. focus (updateStatus $ Running current (atomically $ readTMVar barrier) s) id databaseValues
130135 return act
You can’t perform that action at this time.
0 commit comments