Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r63295 - in trunk: boost/thread/detail libs/thread/src/pthread libs/thread/src/win32
From: steven_at_[hidden]
Date: 2010-06-24 15:38:16


Author: steven_watanabe
Date: 2010-06-24 15:38:16 EDT (Thu, 24 Jun 2010)
New Revision: 63295
URL: http://svn.boost.org/trac/boost/changeset/63295

Log:
Protect get_thread_info from macro expansion to prevent errors on Haiku. Fixes #4341.
Text files modified:
   trunk/boost/thread/detail/thread.hpp | 2 +-
   trunk/libs/thread/src/pthread/thread.cpp | 16 ++++++++--------
   trunk/libs/thread/src/win32/thread.cpp | 16 ++++++++--------
   3 files changed, 17 insertions(+), 17 deletions(-)

Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2010-06-24 15:38:16 EDT (Thu, 24 Jun 2010)
@@ -121,7 +121,7 @@
         
         explicit thread(detail::thread_data_ptr data);
 
- detail::thread_data_ptr get_thread_info() const;
+ detail::thread_data_ptr get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const;
 
 #ifndef BOOST_NO_RVALUE_REFERENCES
         template<typename F>

Modified: trunk/libs/thread/src/pthread/thread.cpp
==============================================================================
--- trunk/libs/thread/src/pthread/thread.cpp (original)
+++ trunk/libs/thread/src/pthread/thread.cpp 2010-06-24 15:38:16 EDT (Thu, 24 Jun 2010)
@@ -196,14 +196,14 @@
         detach();
     }
 
- detail::thread_data_ptr thread::get_thread_info() const
+ detail::thread_data_ptr thread::get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const
     {
         return thread_info;
     }
 
     void thread::join()
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             bool do_join=false;
@@ -246,7 +246,7 @@
 
     bool thread::timed_join(system_time const& wait_until)
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             bool do_join=false;
@@ -293,7 +293,7 @@
 
     bool thread::joinable() const
     {
- return get_thread_info();
+ return (get_thread_info)();
     }
 
 
@@ -391,7 +391,7 @@
 
     thread::id thread::get_id() const
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             return id(local_thread_info);
@@ -404,7 +404,7 @@
 
     void thread::interrupt()
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             lock_guard<mutex> lk(local_thread_info->data_mutex);
@@ -418,7 +418,7 @@
 
     bool thread::interruption_requested() const
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             lock_guard<mutex> lk(local_thread_info->data_mutex);
@@ -432,7 +432,7 @@
 
     thread::native_handle_type thread::native_handle()
     {
- detail::thread_data_ptr const local_thread_info=get_thread_info();
+ detail::thread_data_ptr const local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             lock_guard<mutex> lk(local_thread_info->data_mutex);

Modified: trunk/libs/thread/src/win32/thread.cpp
==============================================================================
--- trunk/libs/thread/src/win32/thread.cpp (original)
+++ trunk/libs/thread/src/win32/thread.cpp 2010-06-24 15:38:16 EDT (Thu, 24 Jun 2010)
@@ -244,17 +244,17 @@
     
     thread::id thread::get_id() const
     {
- return thread::id(get_thread_info());
+ return thread::id((get_thread_info)());
     }
 
     bool thread::joinable() const
     {
- return get_thread_info();
+ return (get_thread_info)();
     }
 
     void thread::join()
     {
- detail::thread_data_ptr local_thread_info=get_thread_info();
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             this_thread::interruptible_wait(local_thread_info->thread_handle,detail::timeout::sentinel());
@@ -264,7 +264,7 @@
 
     bool thread::timed_join(boost::system_time const& wait_until)
     {
- detail::thread_data_ptr local_thread_info=get_thread_info();
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             if(!this_thread::interruptible_wait(local_thread_info->thread_handle,get_milliseconds_until(wait_until)))
@@ -288,7 +288,7 @@
     
     void thread::interrupt()
     {
- detail::thread_data_ptr local_thread_info=get_thread_info();
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
         if(local_thread_info)
         {
             local_thread_info->interrupt();
@@ -297,7 +297,7 @@
     
     bool thread::interruption_requested() const
     {
- detail::thread_data_ptr local_thread_info=get_thread_info();
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
         return local_thread_info.get() && (detail::win32::WaitForSingleObject(local_thread_info->interruption_handle,0)==0);
     }
     
@@ -310,11 +310,11 @@
     
     thread::native_handle_type thread::native_handle()
     {
- detail::thread_data_ptr local_thread_info=get_thread_info();
+ detail::thread_data_ptr local_thread_info=(get_thread_info)();
         return local_thread_info?(detail::win32::handle)local_thread_info->thread_handle:detail::win32::invalid_handle_value;
     }
 
- detail::thread_data_ptr thread::get_thread_info() const
+ detail::thread_data_ptr thread::get_thread_info BOOST_PREVENT_MACRO_SUBSTITUTION () const
     {
         return thread_info;
     }


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