From e1ba104359b70d83303caaefce4bcf58c9bd6b76 Mon Sep 17 00:00:00 2001 From: Lukas Pioch Date: Wed, 30 Dec 2015 15:31:42 +0100 Subject: Fixed race conditions --- src/ClientHandle.h | 2 +- src/Server.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ClientHandle.h b/src/ClientHandle.h index d7468d345..22d052f22 100644 --- a/src/ClientHandle.h +++ b/src/ClientHandle.h @@ -415,7 +415,7 @@ private: int m_LastStreamedChunkZ; /** Number of ticks since the last network packet was received (increased in Tick(), reset in OnReceivedData()) */ - int m_TicksSinceLastPacket; + std::atomic m_TicksSinceLastPacket; /** Duration of the last completed client ping. */ std::chrono::steady_clock::duration m_Ping; diff --git a/src/Server.h b/src/Server.h index 4d0bc1c18..9131697c2 100644 --- a/src/Server.h +++ b/src/Server.h @@ -189,7 +189,7 @@ private: bool m_bIsConnected; // true - connected false - not connected - bool m_bRestarting; + std::atomic m_bRestarting; /** The private key used for the assymetric encryption start in the protocols */ cRsaPrivateKey m_PrivateKey; -- cgit v1.2.3