Use 0 to initialize IORef instead of undefined

The "undefined" somehow gets evaluated even though it is overwritten
immediately. The benchmarks crash due to this.
This commit is contained in:
Harendra Kumar 2021-02-10 17:10:16 +05:30 committed by Harendra Kumar
parent 6c02648b7d
commit 44b0ff2ac3

View File

@ -70,7 +70,7 @@ updateWithDelay clock precision timeVar = do
-- writing to it.
asyncClock :: Clock -> Double -> IO (ThreadId, Prim.IORef MicroSecond64)
asyncClock clock g = do
timeVar <- Prim.newIORef undefined
timeVar <- Prim.newIORef 0
updateTimeVar clock timeVar
tid <- forkManaged $ forever (updateWithDelay clock g timeVar)
return (tid, timeVar)