From 91e6122819846d094b4d948b4f4d11d0b7a2297e Mon Sep 17 00:00:00 2001 From: gabime Date: Sun, 2 Feb 2014 00:00:29 +0200 Subject: [PATCH] fix in queue clear --- include/c11log/details/blocking_queue.h | 2 +- src/test.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/c11log/details/blocking_queue.h b/include/c11log/details/blocking_queue.h index 53071dc5..f15fde62 100644 --- a/include/c11log/details/blocking_queue.h +++ b/include/c11log/details/blocking_queue.h @@ -97,7 +97,7 @@ public: { { std::unique_lock ul(mutex_); - q_.swap(queue_t()); + queue_t().swap(q_); } item_popped_cond_.notify_all(); } diff --git a/src/test.cpp b/src/test.cpp index 5f9424b5..c8c6f44e 100644 --- a/src/test.cpp +++ b/src/test.cpp @@ -70,7 +70,8 @@ void popper(Q* q) string output; while(active) { - q->pop(output); + //q->pop(output); + q->clear(); ++pop_count; } }