From 40fe633dbe8fb89d2bc34a55ec4436b9edde3221 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Fri, 7 Feb 2014 02:01:23 +0100 Subject: [PATCH] Fix thread lockup in zone lighter --HG-- branch : build_pipeline_py --- code/nel/include/nel/3d/zone_lighter.h | 1 + code/nel/src/3d/zone_lighter.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/code/nel/include/nel/3d/zone_lighter.h b/code/nel/include/nel/3d/zone_lighter.h index 357917f07..4f2910c52 100644 --- a/code/nel/include/nel/3d/zone_lighter.h +++ b/code/nel/include/nel/3d/zone_lighter.h @@ -466,6 +466,7 @@ private: uint _NumberOfPatchComputed; uint _ProcessCount; uint64 _CPUMask; + NLMISC::CMutex _ProcessExitedMutex; volatile uint _ProcessExited; // *** Bitmap sharing diff --git a/code/nel/src/3d/zone_lighter.cpp b/code/nel/src/3d/zone_lighter.cpp index 0fe7e9b48..1d7ec5a66 100644 --- a/code/nel/src/3d/zone_lighter.cpp +++ b/code/nel/src/3d/zone_lighter.cpp @@ -373,7 +373,9 @@ public: setCPUMask (Thread, _Process); _ZoneLighter->processCalc (_Process, *_Description); + _ZoneLighter->_ProcessExitedMutex.enter(); _ZoneLighter->_ProcessExited++; + _ZoneLighter->_ProcessExitedMutex.leave(); } }; @@ -649,7 +651,9 @@ void NL3D::CRenderZBuffer::run() } // Exit + _ZoneLighter->_ProcessExitedMutex.enter(); _ZoneLighter->_ProcessExited++; + _ZoneLighter->_ProcessExitedMutex.leave(); } // *************************************************************************** @@ -676,7 +680,9 @@ public: void run() { _ZoneLighter->processLightableShapeCalc(_Process, _ShapesToLit, _FirstShape, _LastShape, *_Description); + _ZoneLighter->_ProcessExitedMutex.enter(); _ZoneLighter->_ProcessExited++; + _ZoneLighter->_ProcessExitedMutex.leave(); } private: CZoneLighter *_ZoneLighter;