Boost logo

Boost-Commit :

From: xushiweizh_at_[hidden]
Date: 2008-06-03 04:58:10


Author: xushiwei
Date: 2008-06-03 04:58:10 EDT (Tue, 03 Jun 2008)
New Revision: 46075
URL: http://svn.boost.org/trac/boost/changeset/46075

Log:
atomic
Binary files modified:
   sandbox/memory/libs/memory/bin/linux/libboost-memory.so
Text files modified:
   sandbox/memory/boost/detail/winapi/atomic/atomic_builtins.hpp | 10 ++++++++--
   sandbox/memory/boost/memory/system_pool.hpp | 30 ++++++++++++++++++++----------
   2 files changed, 28 insertions(+), 12 deletions(-)

Modified: sandbox/memory/boost/detail/winapi/atomic/atomic_builtins.hpp
==============================================================================
--- sandbox/memory/boost/detail/winapi/atomic/atomic_builtins.hpp (original)
+++ sandbox/memory/boost/detail/winapi/atomic/atomic_builtins.hpp 2008-06-03 04:58:10 EDT (Tue, 03 Jun 2008)
@@ -113,7 +113,9 @@
 }
 
 #else
- #error "todo"
+
+#define BOOST_DETAIL_NO_COMPARE_AND_SWAP_128
+
 #endif
 
 // -------------------------------------------------------------------------
@@ -128,12 +130,16 @@
                 Exchange | ((LONG64)(Tag+1) << 32));
 }
 
+#if !defined(BOOST_DETAIL_NO_COMPARE_AND_SWAP_128)
+
 __forceinline bool WINAPI TaggedCompareAndSwap(
         volatile LONG64 Destination[2], LONG64 Comperand, LONG64 Exchange, LONG64 Tag)
 {
         return CompareAndSwap128(Destination, Comperand, Tag, Exchange, Tag+1);
 }
 
+#endif
+
 #if defined(__32BIT__) || defined(__x86_32__)
 
 template <class Type>
@@ -156,7 +162,7 @@
 
 #else
 
-#error "Unknown CPU Type!!!"
+#define BOOST_DETAIL_NO_TAGGED_COMPARE_AND_SWAP_POINTER
 
 #endif
 

Modified: sandbox/memory/boost/memory/system_pool.hpp
==============================================================================
--- sandbox/memory/boost/memory/system_pool.hpp (original)
+++ sandbox/memory/boost/memory/system_pool.hpp 2008-06-03 04:58:10 EDT (Tue, 03 Jun 2008)
@@ -20,9 +20,17 @@
 #include "policy.hpp"
 #endif
 
+#ifndef BOOST_DETAIL_WINAPI_WINBASE_H
+#include <boost/detail/winapi/winbase.h>
+#endif
+
+#if defined(BOOST_DETAIL_NO_TAGGED_COMPARE_AND_SWAP_POINTER)
+#define BOOST_MEMORY_NO_LOCKFREE
+#else
 #ifndef BOOST_LOCKFREE_STACK_HPP
 #include <boost/lockfree/stack.hpp>
 #endif
+#endif
 
 NS_BOOST_MEMORY_BEGIN
 
@@ -57,14 +65,14 @@
 public:
         normal_stack() : m_top(NULL) {}
 
- void BOOST_LOCKFREE_CALL push(node* val)
+ void BOOST_MEMORY_CALL push(node* val)
         {
                 cslock aLock(m_cs);
                 val->_m_prev = m_top;
                 m_top = val;
         }
 
- node* BOOST_LOCKFREE_CALL clear()
+ node* BOOST_MEMORY_CALL clear()
         {
                 cslock aLock(m_cs);
                 node* the_top = m_top;
@@ -72,7 +80,7 @@
                 return the_top;
         }
 
- node* BOOST_LOCKFREE_CALL pop()
+ node* BOOST_MEMORY_CALL pop()
         {
                 cslock aLock(m_cs);
                 node* the_top = m_top;
@@ -83,10 +91,16 @@
         }
 };
 
+#if defined(BOOST_MEMORY_NO_LOCKFREE)
+typedef normal_stack default_stack;
+#else
+typedef NS_BOOST_LOCKFREE::stack default_stack;
+#endif
+
 // -------------------------------------------------------------------------
 // class system_pool_imp
 
-template <class PolicyT, class StackT = NS_BOOST_LOCKFREE::stack>
+template <class PolicyT, class StackT = default_stack>
 class system_pool_imp
 {
 private:
@@ -155,7 +169,7 @@
 // -------------------------------------------------------------------------
 // class system_pool_s
 
-template <class PolicyT, class StackT = NS_BOOST_LOCKFREE::stack>
+template <class PolicyT, class StackT = default_stack>
 class system_pool_s
 {
 private:
@@ -176,11 +190,7 @@
 
 // -------------------------------------------------------------------------
 
-#if defined(BOOST_MEMORY_NO_LOCKFREE)
-typedef system_pool_s<NS_BOOST_MEMORY_POLICY::stdlib, normal_stack> system_pool;
-#else
-typedef system_pool_s<NS_BOOST_MEMORY_POLICY::stdlib> system_pool;
-#endif
+typedef system_pool_s<NS_BOOST_MEMORY_POLICY::stdlib, default_stack> system_pool;
 
 // -------------------------------------------------------------------------
 // $Log: $

Modified: sandbox/memory/libs/memory/bin/linux/libboost-memory.so
==============================================================================
Binary files. No diff available.


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk