small fixes
This commit is contained in:
parent
7339587bd1
commit
007cf8e3f3
1 changed files with 3 additions and 5 deletions
|
@ -5,8 +5,6 @@ import Control.Concurrent (threadDelay)
|
|||
|
||||
import qualified Control.Concurrent.STM as STM
|
||||
|
||||
import Control.Monad (void)
|
||||
|
||||
import Control.Monad.RWS
|
||||
|
||||
import qualified Data.Aeson as A
|
||||
|
@ -14,8 +12,6 @@ import qualified Data.Aeson as A
|
|||
import qualified Data.ByteString as B
|
||||
import qualified Data.ByteString.Lazy.Char8 as B8
|
||||
|
||||
import Data.Maybe (fromJust)
|
||||
|
||||
import qualified Data.Vector.Storable as VS
|
||||
|
||||
import Foreign hiding (void)
|
||||
|
@ -75,7 +71,9 @@ terminateGameOnSigint = do
|
|||
void $ liftIO $ installHandler
|
||||
keyboardSignal
|
||||
(CatchOnce $ do
|
||||
currentState <- STM.atomically $ STM.readTMVar clientState
|
||||
STM.atomically $ do
|
||||
currentState <- STM.readTMVar clientState
|
||||
void $ STM.swapTMVar clientState $ currentState { clientStop = True }
|
||||
threadDelay (10 ^ 6)
|
||||
sendMessage (ClientMessage clientId ClientQuit) sock
|
||||
close sock
|
||||
|
|
Loading…
Reference in a new issue