From 4d5adf4ac44c864e67e8019bb97d89199bb0b4b7 Mon Sep 17 00:00:00 2001 From: wangzhengquan <wangzhengquan85@126.com> Date: 星期四, 06 八月 2020 17:06:27 +0800 Subject: [PATCH] fix survey --- src/queue/include/lock_free_queue.h | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/queue/include/lock_free_queue.h b/src/queue/include/lock_free_queue.h index 25a3392..8a65e81 100644 --- a/src/queue/include/lock_free_queue.h +++ b/src/queue/include/lock_free_queue.h @@ -200,7 +200,7 @@ template <typename T, typename AT> class Q_TYPE> bool LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::push(const ELEM_T &a_data) { -// printf("==================LockFreeQueue push before\n"); + // printf("==================LockFreeQueue push before\n"); if (SemUtil::dec(slots) == -1) { err_msg(errno, "LockFreeQueue push"); return false; @@ -209,7 +209,7 @@ if ( m_qImpl.push(a_data) ) { SemUtil::inc(items); -// printf("==================LockFreeQueue push after\n"); + // printf("==================LockFreeQueue push after\n"); return true; } return false; @@ -274,7 +274,7 @@ template <typename T, typename AT> class Q_TYPE> bool LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::pop(ELEM_T &a_data) { -// printf("==================LockFreeQueue pop before\n"); + // printf("==================LockFreeQueue pop before\n"); if (SemUtil::dec(items) == -1) { err_msg(errno, "LockFreeQueue pop"); return false; @@ -282,7 +282,7 @@ if (m_qImpl.pop(a_data)) { SemUtil::inc(slots); -// printf("==================LockFreeQueue pop after\n"); + // printf("==================LockFreeQueue pop after\n"); return true; } return false; @@ -319,6 +319,7 @@ template <typename T, typename AT> class Q_TYPE> bool LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::pop_timeout(ELEM_T &a_data, struct timespec * timeout) { +// printf("==================LockFreeQueue pop_timeout before\n"); if (SemUtil::dec_timeout(items, timeout) == -1) { if (errno == EAGAIN) return false; @@ -329,7 +330,8 @@ } if (m_qImpl.pop(a_data)) { - SemUtil::inc(slots); + SemUtil::inc(slots); +// printf("==================LockFreeQueue pop_timeout after\n"); return true; } return false; -- Gitblit v1.8.0