Boost logo

Boost-Commit :

From: anthony_at_[hidden]
Date: 2008-07-16 09:19:44


Author: anthonyw
Date: 2008-07-16 09:19:43 EDT (Wed, 16 Jul 2008)
New Revision: 47471
URL: http://svn.boost.org/trac/boost/changeset/47471

Log:
Fixes to make basic thread functionality work with Borland compilers again
Text files modified:
   trunk/boost/thread/detail/move.hpp | 4 ++++
   trunk/boost/thread/detail/thread.hpp | 11 ++++++++++-
   trunk/boost/thread/locks.hpp | 6 +++---
   3 files changed, 17 insertions(+), 4 deletions(-)

Modified: trunk/boost/thread/detail/move.hpp
==============================================================================
--- trunk/boost/thread/detail/move.hpp (original)
+++ trunk/boost/thread/detail/move.hpp 2008-07-16 09:19:43 EDT (Wed, 16 Jul 2008)
@@ -6,8 +6,10 @@
 #ifndef BOOST_THREAD_MOVE_HPP
 #define BOOST_THREAD_MOVE_HPP
 
+#ifndef __BORLANDC__
 #include <boost/utility/enable_if.hpp>
 #include <boost/type_traits/is_convertible.hpp>
+#endif
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -37,11 +39,13 @@
         };
     }
 
+#ifndef __BORLANDC__
     template<typename T>
     typename enable_if<boost::is_convertible<T&,detail::thread_move_t<T> >, detail::thread_move_t<T> >::type move(T& t)
     {
         return t;
     }
+#endif
     
     template<typename T>
     detail::thread_move_t<T> move(detail::thread_move_t<T> t)

Modified: trunk/boost/thread/detail/thread.hpp
==============================================================================
--- trunk/boost/thread/detail/thread.hpp (original)
+++ trunk/boost/thread/detail/thread.hpp 2008-07-16 09:19:43 EDT (Wed, 16 Jul 2008)
@@ -173,15 +173,24 @@
         }
         
 #else
+#ifdef __BORLANDC__
+ template <class F>
+ explicit thread(F f):
+ thread_info(make_thread_info(f))
+ {
+ start_thread();
+ }
+#else
         template <class F>
         explicit thread(F f,typename disable_if<boost::is_convertible<F&,detail::thread_move_t<F> >, dummy* >::type=0):
             thread_info(make_thread_info(f))
         {
             start_thread();
         }
+#endif
         
         template <class F>
- thread(detail::thread_move_t<F> f):
+ explicit thread(detail::thread_move_t<F> f):
             thread_info(make_thread_info(f))
         {
             start_thread();

Modified: trunk/boost/thread/locks.hpp
==============================================================================
--- trunk/boost/thread/locks.hpp (original)
+++ trunk/boost/thread/locks.hpp 2008-07-16 09:19:43 EDT (Wed, 16 Jul 2008)
@@ -449,7 +449,7 @@
             std::swap(m,other.m);
             std::swap(is_locked,other.is_locked);
         }
- void swap(boost::detail::thread_move_t<shared_lock> other)
+ void swap(boost::detail::thread_move_t<shared_lock<Mutex> > other)
         {
             std::swap(m,other->m);
             std::swap(is_locked,other->is_locked);
@@ -515,7 +515,7 @@
             is_locked=false;
         }
             
- typedef void (shared_lock::*bool_type)();
+ typedef void (shared_lock<Mutex>::*bool_type)();
         operator bool_type() const
         {
             return is_locked?&shared_lock::lock:0;
@@ -846,7 +846,7 @@
             typedef typename base::bool_type bool_type;
             operator bool_type() const
             {
- return static_cast<base const&>(*this);
+ return base::operator bool_type();
             }
         };
 


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