Kaynağa Gözat

Renamed SpScUnboundedQueue.

bkaradzic 13 yıl önce
ebeveyn
işleme
7b3a1f0255
2 değiştirilmiş dosya ile 15 ekleme ve 15 silme
  1. 3 3
      include/bx/macros.h
  2. 12 12
      include/bx/spscqueue.h

+ 3 - 3
include/bx/macros.h

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

+ 12 - 12
include/bx/spscqueue.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