Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r54155 - sandbox/monotonic/boost/monotonic
From: christian.schladetsch_at_[hidden]
Date: 2009-06-21 19:12:53


Author: cschladetsch
Date: 2009-06-21 19:12:52 EDT (Sun, 21 Jun 2009)
New Revision: 54155
URL: http://svn.boost.org/trac/boost/changeset/54155

Log:
added custom cleanup function for TLS

Text files modified:
   sandbox/monotonic/boost/monotonic/thread_local_storage.hpp | 5 ++++-
   1 files changed, 4 insertions(+), 1 deletions(-)

Modified: sandbox/monotonic/boost/monotonic/thread_local_storage.hpp
==============================================================================
--- sandbox/monotonic/boost/monotonic/thread_local_storage.hpp (original)
+++ sandbox/monotonic/boost/monotonic/thread_local_storage.hpp 2009-06-21 19:12:52 EDT (Sun, 21 Jun 2009)
@@ -20,13 +20,16 @@
                 {
                         typedef storage<InlineSize, MinHeapSize, Al> AllocatorStorage;
                         typedef boost::thread_specific_ptr<AllocatorStorage> Storage;
+ typedef thread_local_storage<InlineSize, MinHeapSize, Al> This;
 
                 private:
                         Storage store;
+ static void no_delete(Storage *) { }
 
                 public:
- thread_local_storage()
+ thread_local_storage() : store(&This::no_delete)
                         {
+ store.reset(&static_thread_local_storage);
                         }
                         size_t used() const
                         {


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