on master help sign in
Use 0 to initialize IORef instead of undefined
44b0ff2Harendra Kumar
src/Streamly/Internal/Data/Time/Clock.hs+1−1
@@ -70,7 +70,7 @@ updateWithDelay clock precision timeVar = do
70-- writing to it.
70-- writing to it.
71asyncClock :: Clock -> Double -> IO (ThreadId, Prim.IORef MicroSecond64)
71asyncClock :: Clock -> Double -> IO (ThreadId, Prim.IORef MicroSecond64)
72asyncClock clock g = do
72asyncClock clock g = do
73− timeVar <- Prim.newIORef undefined
73+ timeVar <- Prim.newIORef 0
74 updateTimeVar clock timeVar
74 updateTimeVar clock timeVar
75 tid <- forkManaged $ forever (updateWithDelay clock g timeVar)
75 tid <- forkManaged $ forever (updateWithDelay clock g timeVar)
76 return (tid, timeVar)
76 return (tid, timeVar)