on master help sign in
use readTVarIO and newTVarIO as specialized atomic versions of readTVar and newTVar
f0fb92aWillem Van Onsem
src/Graphics/Vty.hs+2−2
@@ -166,7 +166,7 @@ internalMkVty :: Input -> Output -> IO Vty
166internalMkVty input out = do
166internalMkVty input out = do
167 reserveDisplay out
167 reserveDisplay out
168
168
169− shutdownVar <- atomically $ newTVar False
169+ shutdownVar <- newTVarIO False
170 let shutdownIo = do
170 let shutdownIo = do
171 alreadyShutdown <- atomically $ swapTVar shutdownVar True
171 alreadyShutdown <- atomically $ swapTVar shutdownVar True
172 when (not alreadyShutdown) $ do
172 when (not alreadyShutdown) $ do
@@ -174,7 +174,7 @@ internalMkVty input out = do
174 releaseDisplay out
174 releaseDisplay out
175 releaseTerminal out
175 releaseTerminal out
176
176
177− let shutdownStatus = atomically $ readTVar shutdownVar
177+ let shutdownStatus = readTVarIO shutdownVar
178
178
179 lastPicRef <- newIORef Nothing
179 lastPicRef <- newIORef Nothing
180 lastUpdateRef <- newIORef Nothing
180 lastUpdateRef <- newIORef Nothing