From d4289eee3c0e282459ca0301efe15a475c6c5fda Mon Sep 17 00:00:00 2001 From: tycho Date: Sat, 19 Dec 2015 21:48:19 +0000 Subject: Fix race condition --- src/SpawnPrepare.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/SpawnPrepare.h') diff --git a/src/SpawnPrepare.h b/src/SpawnPrepare.h index cc0da504e..3f4a3b377 100644 --- a/src/SpawnPrepare.h +++ b/src/SpawnPrepare.h @@ -1,6 +1,8 @@ #pragma once +#include + class cWorld; @@ -25,7 +27,7 @@ protected: int m_MaxIdx; /** Total number of chunks already finished preparing. Preparation finishes when this number reaches m_MaxIdx. */ - int m_NumPrepared; + std::atomic m_NumPrepared; /** Event used to signal that the preparation is finished. */ cEvent m_EvtFinished; -- cgit v1.2.3