File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ import Control.Exception.Safe (bracket)
20
20
21
21
import Control.Monad (guard )
22
22
23
- import Control.Monad.STM (STM , atomically , retry )
23
+ import Control.Monad.STM (STM , atomically )
24
24
25
25
import Control.Concurrent.Async (concurrently )
26
26
@@ -90,7 +90,7 @@ unforkAsyncVoidIO action =
90
90
unforkAsyncSTM ::
91
91
(task -> IO result )
92
92
-- ^ Action that needs to be run serially
93
- -> ((task -> STM (STM result )) -> IO conclusion )
93
+ -> ((task -> STM (STM ( Maybe result ) )) -> IO conclusion )
94
94
-- ^ Continuation with a thread-safe version of the action
95
95
-> IO conclusion
96
96
unforkAsyncSTM action =
@@ -99,11 +99,7 @@ unforkAsyncSTM action =
99
99
threadSafeAction run arg = do
100
100
resultVar <- newTVar Nothing
101
101
enqueue run Task { arg, resultVar }
102
- pure do
103
- m <- readTVar resultVar
104
- case m of
105
- Nothing -> retry
106
- Just x -> pure x
102
+ pure (readTVar resultVar)
107
103
108
104
step Task { arg, resultVar } = do
109
105
b <- action arg
You can’t perform that action at this time.
0 commit comments