diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2024-06-30 17:47:45 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2024-06-30 21:46:19 +0200 |
commit | c6ae47e2d1440fbc38d61e38c2d2a1d5843475d1 (patch) | |
tree | 53ba21becbc5f35f343c50c38e7cc47f9dba7d78 /src/Erebos | |
parent | 234feea88c2edd6eac5199c1223dd10d09badbd4 (diff) |
Network: use Monotonic instead of MonotonicRaw clock
Diffstat (limited to 'src/Erebos')
-rw-r--r-- | src/Erebos/Network/Protocol.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Erebos/Network/Protocol.hs b/src/Erebos/Network/Protocol.hs index a009ad1..b0047fc 100644 --- a/src/Erebos/Network/Protocol.hs +++ b/src/Erebos/Network/Protocol.hs @@ -440,7 +440,7 @@ erebosNetworkProtocol initialIdentity gLog gDataFlow gControlFlow = do mStorage <- memoryStorage gStorage <- derivePartialStorage mStorage - startTime <- getTime MonotonicRaw + startTime <- getTime Monotonic gNowVar <- newTVarIO startTime gNextTimeout <- newTVarIO startTime gInitConfig <- store mStorage $ (Rec [] :: Object) @@ -448,7 +448,7 @@ erebosNetworkProtocol initialIdentity gLog gDataFlow gControlFlow = do let gs = GlobalState {..} let signalTimeouts = forever $ do - now <- getTime MonotonicRaw + now <- getTime Monotonic next <- atomically $ do writeTVar gNowVar now readTVar gNextTimeout @@ -715,7 +715,7 @@ reservePacket conn@Connection {..} = do resendBytes :: Connection addr -> Maybe ReservedToSend -> SentPacket -> IO () resendBytes Connection {..} reserved sp = do let GlobalState {..} = cGlobalState - now <- getTime MonotonicRaw + now <- getTime Monotonic atomically $ do when (isJust reserved) $ do modifyTVar' cReservedPackets (subtract 1) |