mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Renamed SpScUnboundedQueue.
This commit is contained in:
@@ -55,8 +55,8 @@
|
||||
# define BX_TRACE(...) do {} while(0)
|
||||
#endif // BX_TRACE
|
||||
|
||||
#ifndef BX_CONFIG_SPSCQUEUE_USE_NAIVE
|
||||
# define BX_CONFIG_SPSCQUEUE_USE_NAIVE 0
|
||||
#endif // BX_CONFIG_SPSCQUEUE_USE_NAIVE
|
||||
#ifndef BX_CONFIG_SPSCQUEUE_USE_MUTEX
|
||||
# define BX_CONFIG_SPSCQUEUE_USE_MUTEX 0
|
||||
#endif // BX_CONFIG_SPSCQUEUE_USE_MUTEX
|
||||
|
||||
#endif // __BX_MACROS_H__
|
||||
|
||||
@@ -17,17 +17,17 @@ namespace bx
|
||||
{
|
||||
// http://drdobbs.com/article/print?articleId=210604448&siteSectionName=
|
||||
template <typename Ty>
|
||||
class SpScUnboundedQueueOptimized
|
||||
class SpScUnboundedQueueLf
|
||||
{
|
||||
public:
|
||||
SpScUnboundedQueueOptimized()
|
||||
SpScUnboundedQueueLf()
|
||||
: m_first(new Node(NULL) )
|
||||
, m_divider(m_first)
|
||||
, m_last(m_first)
|
||||
{
|
||||
}
|
||||
|
||||
~SpScUnboundedQueueOptimized()
|
||||
~SpScUnboundedQueueLf()
|
||||
{
|
||||
while (NULL != m_first)
|
||||
{
|
||||
@@ -73,8 +73,8 @@ namespace bx
|
||||
}
|
||||
|
||||
private:
|
||||
SpScUnboundedQueueOptimized(const SpScUnboundedQueueOptimized& _rhs); // no copy constructor
|
||||
SpScUnboundedQueueOptimized& operator=(const SpScUnboundedQueueOptimized& _rhs); // no assignment operator
|
||||
SpScUnboundedQueueLf(const SpScUnboundedQueueLf& _rhs); // no copy constructor
|
||||
SpScUnboundedQueueLf& operator=(const SpScUnboundedQueueLf& _rhs); // no assignment operator
|
||||
|
||||
struct Node
|
||||
{
|
||||
@@ -94,14 +94,14 @@ namespace bx
|
||||
};
|
||||
|
||||
template<typename Ty>
|
||||
class SpScUnboundedQueueNaive
|
||||
class SpScUnboundedQueueMutex
|
||||
{
|
||||
public:
|
||||
SpScUnboundedQueueNaive()
|
||||
SpScUnboundedQueueMutex()
|
||||
{
|
||||
}
|
||||
|
||||
~SpScUnboundedQueueNaive()
|
||||
~SpScUnboundedQueueMutex()
|
||||
{
|
||||
BX_CHECK(m_queue.empty(), "Queue is not empty!");
|
||||
}
|
||||
@@ -141,11 +141,11 @@ namespace bx
|
||||
std::list<Ty*> m_queue;
|
||||
};
|
||||
|
||||
#if BX_CONFIG_SPSCQUEUE_USE_NAIVE
|
||||
# define SpScUnboundedQueue SpScUnboundedQueueNaive
|
||||
#if BX_CONFIG_SPSCQUEUE_USE_MUTEX
|
||||
# define SpScUnboundedQueue SpScUnboundedQueueMutex
|
||||
#else
|
||||
# define SpScUnboundedQueue SpScUnboundedQueueOptimized
|
||||
#endif // BX_CONFIG_NAIVE
|
||||
# define SpScUnboundedQueue SpScUnboundedQueueLf
|
||||
#endif // BX_CONFIG_SPSCQUEUE_USE_MUTEX
|
||||
|
||||
} // namespace bx
|
||||
|
||||
|
||||
Reference in New Issue
Block a user