mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 02:46:33 +01:00
Core/Threading: Fixed possible race condition with m_timeOutTime and fixed Thread #1: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread in PCQ
This commit is contained in:
@@ -39,10 +39,8 @@ public:
|
||||
|
||||
void Push(const T& value)
|
||||
{
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_queueLock);
|
||||
_queue.push(std::move(value));
|
||||
}
|
||||
std::lock_guard<std::mutex> lock(_queueLock);
|
||||
_queue.push(std::move(value));
|
||||
|
||||
_condition.notify_one();
|
||||
}
|
||||
@@ -72,10 +70,7 @@ public:
|
||||
{
|
||||
std::unique_lock<std::mutex> lock(_queueLock);
|
||||
|
||||
while (_queue.empty() && !_shutdown)
|
||||
{
|
||||
_condition.wait(lock);
|
||||
}
|
||||
_condition.wait(lock, [this]() { return !_queue.empty() || _shutdown; });
|
||||
|
||||
if (_queue.empty() || _shutdown)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user