Fix rare world lighting thread race
This commit is contained in:
parent
cb1390e9f3
commit
7d847fcd6a
@ -92,6 +92,7 @@ WorldClient::~WorldClient() {
|
||||
m_lightingCond.broadcast();
|
||||
}
|
||||
|
||||
m_lightingThread.finish();
|
||||
clearWorld();
|
||||
}
|
||||
|
||||
@ -1446,11 +1447,10 @@ void WorldClient::lightingTileGather() {
|
||||
|
||||
void WorldClient::lightingMain() {
|
||||
while (true) {
|
||||
MutexLocker locker(m_lightingMutex);
|
||||
if (m_stopLightingThread)
|
||||
return;
|
||||
|
||||
MutexLocker locker(m_lightingMutex);
|
||||
|
||||
if (m_renderData) {
|
||||
int64_t start = Time::monotonicMilliseconds();
|
||||
|
||||
|
@ -252,7 +252,7 @@ private:
|
||||
mutable Mutex m_lightingMutex;
|
||||
mutable ConditionVariable m_lightingCond;
|
||||
mutable WorldRenderData* m_renderData;
|
||||
bool m_stopLightingThread;
|
||||
atomic<bool> m_stopLightingThread;
|
||||
|
||||
SkyPtr m_sky;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user