mirror of
https://github.com/ilyakooo0/vty.git
synced 2024-11-25 19:22:08 +03:00
use readTVarIO and newTVarIO as specialized atomic versions of readTVar and newTVar
This commit is contained in:
parent
e886dc0f83
commit
f0fb92aca0
@ -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