| | |
| | | #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 |
| | | |
| | |
| | | |
| | | public: |
| | | sem_t mutex; |
| | | |
| | | |
| | | LockFreeQueue(size_t qsize = LOCK_FREE_Q_DEFAULT_SIZE); |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | 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); |
| | |
| | | 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 |