Skip to content

Commit 8f37e25

Browse files
committed
enforce build state changes
1 parent 969bce9 commit 8f37e25

File tree

1 file changed

+4
-4
lines changed
  • hls-graph/src/Development/IDE/Graph/Internal

1 file changed

+4
-4
lines changed

hls-graph/src/Development/IDE/Graph/Internal/Database.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ builder db stack keys = do
122122
return res
123123

124124
builderOne :: Database -> Stack -> Key -> AIO (Key, IO Result)
125-
builderOne db@Database {..} stack id = UE.mask_ $ do
125+
builderOne db@Database {..} stack id = UE.uninterruptibleMask $ \restore -> do
126126
current <- liftIO $ readTVarIO databaseStep
127-
(k, registerWaitResult) <- liftIO $ atomicallyNamed "builder" $ do
127+
(k, registerWaitResult) <- restore $ liftIO $ atomicallyNamed "builder" $ do
128128
-- Spawn the id if needed
129129
status <- SMap.lookup id databaseValues
130130
val <- case viewDirty current $ maybe (Dirty Nothing) keyStatus status of
131131
Dirty s -> do
132132
let act =
133133
asyncWithCleanUp
134-
( refresh db stack id s
135-
`UE.onException` liftIO (atomicallyNamed "builder - onException" (SMap.focus updateDirty id databaseValues))
134+
((restore $ refresh db stack id s)
135+
`UE.onException` UE.uninterruptibleMask_ (liftIO (atomicallyNamed "builder - onException" (SMap.focus updateDirty id databaseValues)))
136136
)
137137
SMap.focus (updateStatus $ Running current s) id databaseValues
138138
return act

0 commit comments

Comments
 (0)