on master help sign in
comments.
66003d4Kazu Yamamoto
warp/Network/Wai/Handler/Warp/Run.hs+1
@@ -351,6 +351,7 @@ setSocketCloseOnExec socket =
351
351
352gracefulShutdown :: Counter -> IO ()
352gracefulShutdown :: Counter -> IO ()
353gracefulShutdown counter = do
353gracefulShutdown counter = do
354+ -- To avoid race condition, we just use threadDelay, not MVar.
354 threadDelay 10000000
355 threadDelay 10000000
355 noConnections <- isZero counter
356 noConnections <- isZero counter
356 unless noConnections $ gracefulShutdown counter
357 unless noConnections $ gracefulShutdown counter