fix MVar infinite blocking
This commit is contained in:
parent
2719a956d5
commit
59365116f3
1 changed files with 3 additions and 1 deletions
|
@ -62,7 +62,9 @@ performXhr xhr request = do
|
||||||
callback <- onReadyStateChange xhr $ do
|
callback <- onReadyStateChange xhr $ do
|
||||||
state <- readyState xhr
|
state <- readyState xhr
|
||||||
case state of
|
case state of
|
||||||
4 -> putMVar waiter ()
|
4 -> do
|
||||||
|
toPut <- isEmptyMVar waiter
|
||||||
|
when toPut (putMVar waiter ())
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
openXhr xhr (cs $ method request) (toUrl request) True
|
openXhr xhr (cs $ method request) (toUrl request) True
|
||||||
setHeaders xhr (requestHeaders request)
|
setHeaders xhr (requestHeaders request)
|
||||||
|
|
Loading…
Reference in a new issue