Race condition in ThreadPool #1906

This commit is contained in:
Alex Fabijanic 2017-10-20 21:41:15 -05:00
parent 6b19b56bd8
commit 5b91bc65b6

View File

@ -192,10 +192,11 @@ void PooledThread::run()
_mutex.lock(); _mutex.lock();
if (_pTarget) // a NULL target means kill yourself if (_pTarget) // a NULL target means kill yourself
{ {
Runnable* pTarget = _pTarget;
_mutex.unlock(); _mutex.unlock();
try try
{ {
_pTarget->run(); pTarget->run();
} }
catch (Exception& exc) catch (Exception& exc)
{ {