mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 08:14:48 +02:00
Merge pull request #7479 from sethalves/fix-logging-crash
fix locking in GenericQueueThread::process
This commit is contained in:
commit
bb42d84bbd
1 changed files with 6 additions and 1 deletions
|
@ -45,18 +45,23 @@ protected:
|
|||
}
|
||||
|
||||
virtual bool process() {
|
||||
lock();
|
||||
if (!_items.size()) {
|
||||
unlock();
|
||||
_hasItemsMutex.lock();
|
||||
_hasItems.wait(&_hasItemsMutex, getMaxWait());
|
||||
_hasItemsMutex.unlock();
|
||||
} else {
|
||||
unlock();
|
||||
}
|
||||
|
||||
lock();
|
||||
if (!_items.size()) {
|
||||
unlock();
|
||||
return isStillRunning();
|
||||
}
|
||||
|
||||
Queue processItems;
|
||||
lock();
|
||||
processItems.swap(_items);
|
||||
unlock();
|
||||
return processQueueItems(processItems);
|
||||
|
|
Loading…
Reference in a new issue