diff options
author | Shauren <shauren.trinity@gmail.com> | 2014-10-02 20:09:08 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2014-10-02 20:09:08 +0200 |
commit | 04b6f9111aa98cd0f4851797d160e02666417e80 (patch) | |
tree | 7e44b6960251bb3cdf0ad9d08c3f4be54bbdfeae /src/server/shared/Threading/ProducerConsumerQueue.h | |
parent | 4322a0dc372c2c6f6e2b291f68d7a5cafafc8f86 (diff) |
Fixed ==25829== Thread #1: pthread_cond_{signal,broadcast}: dubious: associated lock is not held by any thread
==25829== at 0x4C2A1D5: pthread_cond_broadcast_WRK (hg_intercepts.c:891)
==25829== by 0x654A758: std::condition_variable::notify_all() (in /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.17)
==25829== by 0x132305A: ProducerConsumerQueue<SQLOperation*>::Cancel() (ProducerConsumerQueue.h:100)
==25829== by 0x13229A7: DatabaseWorkerPool<WorldDatabaseConnection>::~DatabaseWorkerPool() (DatabaseWorkerPool.h:70)
==25829== by 0x6C6CB21: __run_exit_handlers (exit.c:78)
==25829== by 0x6C6CB74: exit (exit.c:100)
==25829== by 0x6C54EF3: (below main) (libc-start.c:276)
Diffstat (limited to 'src/server/shared/Threading/ProducerConsumerQueue.h')
-rw-r--r-- | src/server/shared/Threading/ProducerConsumerQueue.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/server/shared/Threading/ProducerConsumerQueue.h b/src/server/shared/Threading/ProducerConsumerQueue.h index a76b8b0b5c0..d0b3631a9dd 100644 --- a/src/server/shared/Threading/ProducerConsumerQueue.h +++ b/src/server/shared/Threading/ProducerConsumerQueue.h @@ -82,7 +82,7 @@ public: void Cancel() { - _queueLock.lock(); + std::unique_lock<std::mutex> lock(_queueLock); while (!_queue.empty()) { @@ -95,8 +95,6 @@ public: _shutdown = true; - _queueLock.unlock(); - _condition.notify_all(); } |