Renamed SpScUnboundedQueue.

This commit is contained in:
bkaradzic
2012-04-22 14:13:06 -07:00
parent 4eb80393d1
commit 7b3a1f0255
2 changed files with 15 additions and 15 deletions

View File

@@ -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__

View File

@@ -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