Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r62286 - in sandbox/stm/branches/vbe/boost/stm: . detail memory_managers non_tx/detail tx txw txw2
From: vicente.botet_at_[hidden]
Date: 2010-05-27 21:55:39


Author: viboes
Date: 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
New Revision: 62286
URL: http://svn.boost.org/trac/boost/changeset/62286

Log:
Boost.STM/vbe:
* Remove cache_fct.hpp file
* Add missing static_tss.hpp file
* Cleanup
Added:
   sandbox/stm/branches/vbe/boost/stm/detail/static_tss.hpp (contents, props changed)
Removed:
   sandbox/stm/branches/vbe/boost/stm/cache_fct.hpp
Text files modified:
   sandbox/stm/branches/vbe/boost/stm/base_transaction.hpp | 3 ---
   sandbox/stm/branches/vbe/boost/stm/detail/jenkins_hash.hpp | 22 +++++++++++-----------
   sandbox/stm/branches/vbe/boost/stm/detail/memory_pool.hpp | 2 +-
   sandbox/stm/branches/vbe/boost/stm/language_like.hpp | 6 +++---
   sandbox/stm/branches/vbe/boost/stm/memory_managers/memory_manager.hpp | 1 -
   sandbox/stm/branches/vbe/boost/stm/non_tx/detail/cache_map.hpp | 2 +-
   sandbox/stm/branches/vbe/boost/stm/transaction.hpp | 10 ++++------
   sandbox/stm/branches/vbe/boost/stm/transaction_object.hpp | 1 -
   sandbox/stm/branches/vbe/boost/stm/transaction_object_ptr.hpp | 1 +
   sandbox/stm/branches/vbe/boost/stm/tx/deep_transaction_object.hpp | 2 +-
   sandbox/stm/branches/vbe/boost/stm/tx/shallow_transaction_object.hpp | 2 +-
   sandbox/stm/branches/vbe/boost/stm/tx/trivial_transaction_object.hpp | 2 +-
   sandbox/stm/branches/vbe/boost/stm/txw/transactional_object.hpp | 1 +
   sandbox/stm/branches/vbe/boost/stm/txw2/transactional_object.hpp | 1 +
   14 files changed, 26 insertions(+), 30 deletions(-)

Modified: sandbox/stm/branches/vbe/boost/stm/base_transaction.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/base_transaction.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/base_transaction.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -16,7 +16,6 @@
 
 //-----------------------------------------------------------------------------
 #include <stdarg.h>
-//~ #include <pthread.h>
 #include <boost/thread.hpp>
 //-----------------------------------------------------------------------------
 #include <list>
@@ -27,10 +26,8 @@
 //-----------------------------------------------------------------------------
 #include <boost/stm/contention_managers/base_contention_manager.hpp>
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/exceptions.hpp>
-#include <boost/stm/transaction_object.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/detail/move.hpp>
 

Deleted: sandbox/stm/branches/vbe/boost/stm/cache_fct.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/cache_fct.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
+++ (empty file)
@@ -1,54 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Justin E. Gottchlich 2009.
-// (C) Copyright Vicente J. Botet Escriba 2009.
-// Distributed under the Boost
-// Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or
-// copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See http://www.boost.org/libs/stm for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_STM_CACHE_FCT__HPP
-#define BOOST_STM_CACHE_FCT__HPP
-
-//-----------------------------------------------------------------------------
-#include <stdarg.h>
-//~ #include <pthread.h>
-#include <boost/thread.hpp>
-
-//-----------------------------------------------------------------------------
-#include <list>
-//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
-#include <boost/stm/detail/config.hpp>
-//-----------------------------------------------------------------------------
-//#include <boost/stm/exceptions.hpp>
-//-----------------------------------------------------------------------------
-//#include <boost/stm/detail/memory_pool.hpp>
-//-----------------------------------------------------------------------------
-
-//-----------------------------------------------------------------------------
-namespace boost { namespace stm {
-
-//-----------------------------------------------------------------------------
-// forward declarations
-//-----------------------------------------------------------------------------
-
-class base_transaction_object;
-class transaction;
-
-void cache_release(base_transaction_object* ptr);
-
-
-template <class T> T* cache_allocate(transaction& t);
-template <class T> void cache_deallocate(T* ptr);
-
-
-} // namespace core
-}
-#endif // BOOST_STM_CACHE_FCT__HPP
-
-

Modified: sandbox/stm/branches/vbe/boost/stm/detail/jenkins_hash.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/jenkins_hash.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/jenkins_hash.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -16,7 +16,7 @@
 lookup3.c, by Bob Jenkins, May 2006, Public Domain.
 
 These are functions for producing 32-bit hashes for hash table lookup.
-hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
+hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and JENKINS_HASH_final()
 are externally useful functions. Routines to test the hash are included
 if SELF_TEST is defined. You can use this free for any purpose. It's in
 the public domain. It has no warranty.
@@ -34,7 +34,7 @@
   a += i4; b += i5; c += i6;
   mix(a,b,c);
   a += i7;
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
 then use c as the hash value. If you have a variable length array of
 4-byte integers to hash, use hashword(). If you have a byte array (like
 a character string), use hashlittle(). If you have several byte arrays, or
@@ -47,8 +47,8 @@
 -------------------------------------------------------------------------------
 */
 
-#ifndef BOOST_STM_JENKINS_HAS__HPP
-#define BOOST_STM_JENKINS_HAS__HPP
+#ifndef BOOST_STM_JENKINS_HASH__HPP
+#define BOOST_STM_JENKINS_HASH__HPP
 
 #define SELF_TEST 1
 
@@ -148,7 +148,7 @@
 
 /*
 -------------------------------------------------------------------------------
-final -- final mixing of 3 32-bit values (a,b,c) into c
+JENKINS_HASH_final -- JENKINS_HASH_final mixing of 3 32-bit values (a,b,c) into c
 
 Pairs of (a,b,c) values differing in only a few bits will usually
 produce values of c that look totally different. This was tested for
@@ -171,7 +171,7 @@
  11 8 15 26 3 22 24
 -------------------------------------------------------------------------------
 */
-#define final(a,b,c) \
+#define JENKINS_HASH_final(a,b,c) \
 { \
   c ^= b; c -= rot(b,14); \
   a ^= c; a -= rot(c,11); \
@@ -222,7 +222,7 @@
   case 3 : c+=k[2];
   case 2 : b+=k[1];
   case 1 : a+=k[0];
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
   case 0: /* case 0: nothing left to add */
     break;
   }
@@ -268,7 +268,7 @@
   case 3 : c+=k[2];
   case 2 : b+=k[1];
   case 1 : a+=k[0];
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
   case 0: /* case 0: nothing left to add */
     break;
   }
@@ -469,7 +469,7 @@
     }
   }
 
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
   return c;
 }
 
@@ -654,7 +654,7 @@
     }
   }
 
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
   *pc=c; *pb=b;
 }
 
@@ -784,7 +784,7 @@
     }
   }
 
- final(a,b,c);
+ JENKINS_HASH_final(a,b,c);
   return c;
 }
 

Modified: sandbox/stm/branches/vbe/boost/stm/detail/memory_pool.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/detail/memory_pool.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/detail/memory_pool.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -25,7 +25,7 @@
 
 #include <boost/stm/detail/vector_map.hpp>
 
-#ifdef WIN32
+#if defined(WIN32)
 #pragma warning( disable : 4786 )
 #endif
 

Added: sandbox/stm/branches/vbe/boost/stm/detail/static_tss.hpp
==============================================================================
--- (empty file)
+++ sandbox/stm/branches/vbe/boost/stm/detail/static_tss.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -0,0 +1,79 @@
+// Copyright Stefan Strasser 2010.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+
+#ifndef BOOST_STM_DETAIL_STATIC_TSS_HPP
+#define BOOST_STM_DETAIL_STATIC_TSS_HPP
+
+#include <boost/noncopyable.hpp>
+#include <boost/thread/tss.hpp>
+
+namespace boost {
+namespace stm {
+namespace detail {
+
+template<class T,class Tag,bool Threads=true>
+class static_thread_specific_ptr;
+
+
+template<class T,class Tag>
+class static_thread_specific_ptr<T,Tag,true> : noncopyable{
+private:
+ static_thread_specific_ptr();
+public:
+
+#if ((__GNUC__== 3) && (__GNUC_MINOR__ > 4) || __GNUC__>= 4)
+ static void reset(T *p=0){ ptr=p; }
+ static T *get(){ return ptr; }
+private:
+ static __thread T *ptr;
+};
+
+template<class T,class Tag>
+__thread T *static_thread_specific_ptr<T,Tag,true>::ptr(0);
+
+#elif defined(BOOST_MSVC)
+ static void reset(T *p=0){ ptr=p; }
+ static T *get(){ return ptr; }
+private:
+ static __declspec(thread) T *ptr;
+};
+
+template<class T,class Tag>
+__declspec(thread) T *static_thread_specific_ptr<T,Tag,true>::ptr(0);
+
+
+#else
+ static void reset(T *p=0){ ptr.reset(p); }
+ static T *get(){ return ptr.get(); }
+private:
+ static thread_specific_ptr<T> ptr;
+};
+
+template<class T,class Tag>
+thread_specific_ptr<T> static_thread_specific_ptr<T,Tag,true>::ptr(0); //null deleter
+
+#endif
+
+template<class T,class Tag>
+class static_thread_specific_ptr<T,Tag,false> : noncopyable{
+private:
+ static_thread_specific_ptr();
+public:
+ static void reset(T *p=0){ ptr=p; }
+ static T *get(){ return ptr; }
+private:
+ static T *ptr;
+};
+
+template<class T,class Tag>
+T *static_thread_specific_ptr<T,Tag,false>::ptr(0);
+
+}
+}
+}
+
+
+#endif

Modified: sandbox/stm/branches/vbe/boost/stm/language_like.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/language_like.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/language_like.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -65,7 +65,7 @@
     }
 };
 
-bool no_opt_false() {return false;}
+inline bool no_opt_false() {return false;}
 
 template <typename TX, typename T> T commit_and_return(TX &t, T const& var) {
     T tmp(var);
@@ -78,11 +78,11 @@
     t.commit(); return true;
 }
 
-int get_int(const char* s) {
+inline int get_int(const char* s) {
     return 1+strlen(s);
 }
 
-void commit(std::nothrow_t, transaction&t)
+inline void commit(std::nothrow_t, transaction&t)
 {
     try { t.commit(); }
     catch (...) {}

Modified: sandbox/stm/branches/vbe/boost/stm/memory_managers/memory_manager.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/memory_managers/memory_manager.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/memory_managers/memory_manager.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -26,7 +26,6 @@
 #include <boost/stm/detail/config.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/memory_managers/base_memory_manager.hpp>
 //-----------------------------------------------------------------------------

Modified: sandbox/stm/branches/vbe/boost/stm/non_tx/detail/cache_map.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/non_tx/detail/cache_map.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/non_tx/detail/cache_map.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -22,7 +22,7 @@
 #include <boost/stm/trace.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 //-----------------------------------------------------------------------------
 

Modified: sandbox/stm/branches/vbe/boost/stm/transaction.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/transaction.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/transaction.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -15,7 +15,6 @@
 #define BOOST_STM_TRANSACTION__HPP
 
 //-----------------------------------------------------------------------------
-#include <assert.h>
 //~ #include <pthread.h>
 #include <boost/thread.hpp>
 
@@ -231,7 +230,7 @@
     // thread specific data
     struct tss_context
     {
- inline tss_context()
+ tss_context()
         : tx_()
         #ifndef BOOST_STM_USE_BOOST_MUTEX
         #if WIN32
@@ -249,7 +248,7 @@
             pthread_mutex_init(&mutex_, 0);
             #endif
         }
- inline ~tss_context() {
+ ~tss_context() {
             #ifndef BOOST_STM_USE_BOOST_MUTEX
             pthread_mutex_destroy(&mutex_);
             #endif
@@ -1940,9 +1939,9 @@
 ////////////////////////////////////////
 #ifndef BOOST_STM_HAVE_SINGLE_TSS_CONTEXT_MAP
 ////////////////////////////////////////
-//public:
+public:
     BOOST_STM_ASSERT_VAR_DCL(tx_context &, context_);
-//private:
+private:
 #ifdef BOOST_STM_TX_CONTAINS_REFERENCES_TO_TSS_FIELDS
     //~ mutable WriteContainer * const write_list_ref_;
     BOOST_STM_ASSERT_VAR_DCL(WriteContainer * const, write_list_ref_);
@@ -2576,7 +2575,6 @@
 } // boost namespace
 
 
-#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/detail/transaction_impl.hpp>
 #include <boost/stm/detail/latm_general_impl.hpp>
 

Modified: sandbox/stm/branches/vbe/boost/stm/transaction_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/transaction_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/transaction_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -25,7 +25,6 @@
 #include <boost/stm/detail/config.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 #include <boost/stm/tx/deep_transaction_object.hpp>

Modified: sandbox/stm/branches/vbe/boost/stm/transaction_object_ptr.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/transaction_object_ptr.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/transaction_object_ptr.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -16,6 +16,7 @@
 
 
 #include <boost/stm/base_transaction.hpp>
+#include <boost/stm/transaction_object.hpp>
 
 namespace boost { namespace stm {
 

Modified: sandbox/stm/branches/vbe/boost/stm/tx/deep_transaction_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/tx/deep_transaction_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/tx/deep_transaction_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -26,7 +26,7 @@
 #include <boost/stm/detail/config.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 //-----------------------------------------------------------------------------

Modified: sandbox/stm/branches/vbe/boost/stm/tx/shallow_transaction_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/tx/shallow_transaction_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/tx/shallow_transaction_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -24,7 +24,7 @@
 #include <boost/stm/detail/config.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 #include <boost/mpl/bool.hpp>

Modified: sandbox/stm/branches/vbe/boost/stm/tx/trivial_transaction_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/tx/trivial_transaction_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/tx/trivial_transaction_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -25,7 +25,7 @@
 #include <boost/stm/detail/config.hpp>
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction_object.hpp>
-#include <boost/stm/cache_fct.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/datatypes.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 #include <boost/mpl/and.hpp>

Modified: sandbox/stm/branches/vbe/boost/stm/txw/transactional_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/txw/transactional_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/txw/transactional_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -16,6 +16,7 @@
 
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 //-----------------------------------------------------------------------------
 

Modified: sandbox/stm/branches/vbe/boost/stm/txw2/transactional_object.hpp
==============================================================================
--- sandbox/stm/branches/vbe/boost/stm/txw2/transactional_object.hpp (original)
+++ sandbox/stm/branches/vbe/boost/stm/txw2/transactional_object.hpp 2010-05-27 21:55:38 EDT (Thu, 27 May 2010)
@@ -16,6 +16,7 @@
 
 //-----------------------------------------------------------------------------
 #include <boost/stm/base_transaction.hpp>
+#include <boost/stm/tx_memory_manager.hpp>
 #include <boost/stm/memory_managers/memory_manager.hpp>
 //-----------------------------------------------------------------------------
 


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