From a4d18d6ab3216ce1bf8052f0fdc4ea34bc6385e8 Mon Sep 17 00:00:00 2001
From: wangzhengquan <wangzhengquan85@126.com>
Date: 星期三, 20 一月 2021 19:39:17 +0800
Subject: [PATCH] update

---
 src/queue/lock_free_queue.h |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/queue/lock_free_queue.h b/src/queue/lock_free_queue.h
index 4c55f7b..924537f 100644
--- a/src/queue/lock_free_queue.h
+++ b/src/queue/lock_free_queue.h
@@ -1,3 +1,6 @@
+/**
+ * encapsulate array_lock_free_queue, add semphore. populate in kernal space.
+ */
 #ifndef __LOCK_FREE_QUEUE_H__
 #define __LOCK_FREE_QUEUE_H__
 
@@ -343,19 +346,20 @@
     template <typename T, typename AT> class Q_TYPE>
 int LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::pop_timeout(ELEM_T &a_data, struct timespec * ts)
 {
-// LoggerFactory::getLogger()->debug("=================ts sec = %d, nsec = %ld \n", ts->tv_sec,  ts->tv_nsec );
 
-    LoggerFactory::getLogger()->debug("==================LockFreeQueue pop_timeout before\n");   
+    // LoggerFactory::getLogger()->debug("==================LockFreeQueue pop_timeout before\n");   
     struct timespec timeout = PXSemUtil::calc_sem_timeout(ts);
-// LoggerFactory::getLogger()->debug("================== timeout before sec = %d, nsec = %ld \n", timeout.tv_sec,  timeout.tv_nsec );
 
     while (sem_timedwait(&items, &timeout) == -1) {
-        if (errno == ETIMEDOUT)
+        // LoggerFactory::getLogger()->error(errno, "1 LockFreeQueue pop_timeout %d %d", errno, ETIMEDOUT);
+        if (errno == ETIMEDOUT) {
+             // LoggerFactory::getLogger()->error(errno, "2 LockFreeQueue pop_timeout %d %d", errno, EBUS_TIMEOUT);
             return EBUS_TIMEOUT;
+        }
         else if(errno == EINTR)
             continue;
         else {
-          LoggerFactory::getLogger()->error(errno, "LockFreeQueue pop_timeout %d", errno);
+          LoggerFactory::getLogger()->error(errno, "3  LockFreeQueue pop_timeout %d", errno);
           return errno;
         }
     }

--
Gitblit v1.8.0