Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r86391 - in trunk/libs/sync: src test
From: andrey.semashev_at_[hidden]
Date: 2013-10-22 10:04:00


Author: andysem
Date: 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013)
New Revision: 86391
URL: http://svn.boost.org/trac/boost/changeset/86391

Log:
Fixed compilation on Windows.

Text files modified:
   trunk/libs/sync/src/tss_manager.hpp | 2 +-
   trunk/libs/sync/src/tss_windows.cpp | 4 ++--
   trunk/libs/sync/src/tss_windows_dll.cpp | 12 ++++++------
   trunk/libs/sync/src/tss_windows_pe.cpp | 20 ++++++++++----------
   trunk/libs/sync/test/Jamfile.v2 | 1 +
   5 files changed, 20 insertions(+), 19 deletions(-)

Modified: trunk/libs/sync/src/tss_manager.hpp
==============================================================================
--- trunk/libs/sync/src/tss_manager.hpp Tue Oct 22 09:31:21 2013 (r86390)
+++ trunk/libs/sync/src/tss_manager.hpp 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013) (r86391)
@@ -150,7 +150,7 @@
         {
             std::vector< void* > storage;
             storage.swap(p->m_storage);
- for (thread_specific_key key = 0, n = storage.size(); key < n; ++key)
+ for (thread_specific_key key = 0, n = static_cast< thread_specific_key >(storage.size()); key < n; ++key)
             {
                 void* const value = storage[key];
                 if (value)

Modified: trunk/libs/sync/src/tss_windows.cpp
==============================================================================
--- trunk/libs/sync/src/tss_windows.cpp Tue Oct 22 09:31:21 2013 (r86390)
+++ trunk/libs/sync/src/tss_windows.cpp 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013) (r86391)
@@ -127,12 +127,12 @@
 BOOST_SYNC_API void add_thread_exit_callback(at_thread_exit_callback callback, void* context)
 {
     init_tss_once();
- tss_manager::thread_context* ctx = static_cast< tss_manager::thread_context* >(pthread_getspecific(tss_key));
+ tss_manager::thread_context* ctx = static_cast< tss_manager::thread_context* >(TlsGetValue(tss_key));
 
     if (!ctx)
     {
         ctx = tss_mgr->create_thread_context();
- pthread_setspecific(tss_key, ctx);
+ TlsSetValue(tss_key, ctx);
     }
 
     ctx->add_at_exit_entry(callback, context);

Modified: trunk/libs/sync/src/tss_windows_dll.cpp
==============================================================================
--- trunk/libs/sync/src/tss_windows_dll.cpp Tue Oct 22 09:31:21 2013 (r86390)
+++ trunk/libs/sync/src/tss_windows_dll.cpp 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013) (r86391)
@@ -22,27 +22,27 @@
     {
     case DLL_PROCESS_ATTACH:
         {
- boost::on_process_enter();
- boost::on_thread_enter();
+ boost::sync::detail::windows::on_process_enter();
+ boost::sync::detail::windows::on_thread_enter();
             break;
         }
 
     case DLL_THREAD_ATTACH:
         {
- boost::on_thread_enter();
+ boost::sync::detail::windows::on_thread_enter();
             break;
         }
 
     case DLL_THREAD_DETACH:
         {
- boost::on_thread_exit();
+ boost::sync::detail::windows::on_thread_exit();
             break;
         }
 
     case DLL_PROCESS_DETACH:
         {
- boost::on_thread_exit();
- boost::on_process_exit();
+ boost::sync::detail::windows::on_thread_exit();
+ boost::sync::detail::windows::on_process_exit();
             break;
         }
     }

Modified: trunk/libs/sync/src/tss_windows_pe.cpp
==============================================================================
--- trunk/libs/sync/src/tss_windows_pe.cpp Tue Oct 22 09:31:21 2013 (r86390)
+++ trunk/libs/sync/src/tss_windows_pe.cpp 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013) (r86391)
@@ -44,7 +44,7 @@
     {
     case DLL_THREAD_DETACH:
         {
- boost::on_thread_exit();
+ boost::sync::detail::windows::on_thread_exit();
             break;
         }
     }
@@ -61,9 +61,9 @@
 #else
 extern "C" {
 
- void (* after_ctors )() __attribute__((section(".ctors"))) = boost::on_process_enter;
- void (* before_dtors)() __attribute__((section(".dtors"))) = boost::on_thread_exit;
- void (* after_dtors )() __attribute__((section(".dtors.zzz"))) = boost::on_process_exit;
+ void (* after_ctors )() __attribute__((section(".ctors"))) = boost::sync::detail::windows::on_process_enter;
+ void (* before_dtors)() __attribute__((section(".dtors"))) = boost::sync::detail::windows::on_thread_exit;
+ void (* after_dtors )() __attribute__((section(".dtors.zzz"))) = boost::sync::detail::windows::on_process_exit;
 
     ULONG __tls_index__ = 0;
     char __tls_end__ __attribute__((section(".tls$zzz"))) = 0;
@@ -253,18 +253,18 @@
     //for destructors of global objects, so that
     //shouldn't be a problem.
 
- atexit(boost::on_thread_exit);
+ atexit(boost::sync::detail::windows::on_thread_exit);
 
     //Call Boost process entry callback here
 
- boost::on_process_enter();
+ boost::sync::detail::windows::on_process_enter();
 
     return INIRETSUCCESS;
 }
 
 PVAPI on_process_term()
 {
- boost::on_process_exit();
+ boost::sync::detail::windows::on_process_exit();
     return INIRETSUCCESS;
 }
 
@@ -273,7 +273,7 @@
     switch (dwReason)
     {
     case DLL_THREAD_DETACH:
- boost::on_thread_exit();
+ boost::sync::detail::windows::on_thread_exit();
         break;
     }
 }
@@ -287,10 +287,10 @@
     switch (dwReason)
     {
     case DLL_THREAD_DETACH:
- boost::on_thread_exit();
+ boost::sync::detail::windows::on_thread_exit();
         break;
     case DLL_PROCESS_DETACH:
- boost::on_process_exit();
+ boost::sync::detail::windows::on_process_exit();
         break;
     }
 

Modified: trunk/libs/sync/test/Jamfile.v2
==============================================================================
--- trunk/libs/sync/test/Jamfile.v2 Tue Oct 22 09:31:21 2013 (r86390)
+++ trunk/libs/sync/test/Jamfile.v2 2013-10-22 10:04:00 EDT (Tue, 22 Oct 2013) (r86391)
@@ -11,6 +11,7 @@
     : requirements
         <threading>multi
         <hardcode-dll-paths>true
+ <library>/boost/sync//boost_sync
         <library>/boost/system//boost_system
         <library>/boost/thread//boost_thread
         <library>/boost/date_time//boost_date_time


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