mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-25 19:22:08 +03:00
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:
commit
fdad9586c4
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user