wangzhengquan
2021-02-08 82841486c36288d73e95f3316e91dd7a522d8602
src/queue/lock_free_queue.h
@@ -13,6 +13,7 @@
#include "psem.h"
#include "bus_error.h"
#include "bus_def.h"
#include "read_write_lock.h"
// default Queue size
#define LOCK_FREE_Q_DEFAULT_SIZE 16
@@ -85,6 +86,7 @@
public:
  sem_t mutex;
  LockFreeQueue(size_t qsize = LOCK_FREE_Q_DEFAULT_SIZE);
@@ -269,13 +271,13 @@
    }
  }
  if (m_qImpl.pop(a_data)) {
    psem_post(&slots);
    // sigprocmask(SIG_SETMASK, &pre, NULL);
    // LoggerFactory::getLogger()->debug("==================LockFreeQueue pop after\n");
    return 0;
  }
  LABEL_FAILTURE:
  // sigprocmask(SIG_SETMASK, &pre, NULL);
@@ -301,7 +303,8 @@
  typename Allocator,
  template<typename T, typename AT> class Q_TYPE>
void LockFreeQueue<ELEM_T, Allocator, Q_TYPE>::operator delete(void *p) {
  return Allocator::deallocate(p);
  LockFreeQueue<ELEM_T, Allocator, Q_TYPE> * _que =  (LockFreeQueue<ELEM_T, Allocator, Q_TYPE> * )p;
  Allocator::deallocate(p);
}
// include implementation files