diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-14 11:03:56 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-10-14 11:03:56 +0000 |
commit | 73871d40a7c2731a0e2ada3b8df1500c86023420 (patch) | |
tree | 697e8833508f5f874883a505f71f59c6a4828adc /document | |
parent | 001bdf0053ba9cb02e20afcceb9d0f7ed63f1178 (diff) |
Assert instead of silently fix
Diffstat (limited to 'document')
-rw-r--r-- | document/src/vespa/document/util/queue.h | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/document/src/vespa/document/util/queue.h b/document/src/vespa/document/util/queue.h index 770acda792d..ad5ad07b8ac 100644 --- a/document/src/vespa/document/util/queue.h +++ b/document/src/vespa/document/util/queue.h @@ -22,15 +22,8 @@ public: Semaphore(int count=0) : _count(count), _numWaiters(0), _lock() { } ~Semaphore() { - // XXX alternative: assert(_numWaiters == 0) - while (true) { - { - std::lock_guard guard(_lock); - if (_numWaiters == 0) break; - _count++; - } - _cond.notify_one(); - } + std::lock_guard guard(_lock); + assert(_numWaiters == 0); } bool wait(int ms) { |