Merge pull request #214 from hapytex/hlint/atomically-to-io

use readTVarIO and newTVarIO as specialized atomic versions of readTV…
This commit is contained in:
Jonathan Daugherty 2021-02-17 14:48:41 -08:00 committed by GitHub
commit fdad9586c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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