use readTVarIO and newTVarIO as specialized atomic versions of readTVar and newTVar

This commit is contained in:
Willem Van Onsem 2021-02-17 23:46:15 +01:00
parent e886dc0f83
commit f0fb92aca0

View File

@ -166,7 +166,7 @@ internalMkVty :: Input -> Output -> IO Vty
internalMkVty input out = do
reserveDisplay out
shutdownVar <- atomically $ newTVar False
shutdownVar <- newTVarIO False
let shutdownIo = do
alreadyShutdown <- atomically $ swapTVar shutdownVar True
when (not alreadyShutdown) $ do
@ -174,7 +174,7 @@ internalMkVty input out = do
releaseDisplay out
releaseTerminal out
let shutdownStatus = atomically $ readTVar shutdownVar
let shutdownStatus = readTVarIO shutdownVar
lastPicRef <- newIORef Nothing
lastUpdateRef <- newIORef Nothing