summaryrefslogtreecommitdiff
path: root/boost/detail/lightweight_thread.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/detail/lightweight_thread.hpp')
-rw-r--r--boost/detail/lightweight_thread.hpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/boost/detail/lightweight_thread.hpp b/boost/detail/lightweight_thread.hpp
index 6fe70a613d..2145815705 100644
--- a/boost/detail/lightweight_thread.hpp
+++ b/boost/detail/lightweight_thread.hpp
@@ -77,8 +77,16 @@ public:
extern "C" void * lw_thread_routine( void * pv )
{
+#if defined(BOOST_NO_CXX11_SMART_PTR)
+
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#else
+
+ std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+
+#endif
+
pt->run();
return 0;
@@ -88,8 +96,16 @@ extern "C" void * lw_thread_routine( void * pv )
unsigned __stdcall lw_thread_routine( void * pv )
{
+#if defined(BOOST_NO_CXX11_SMART_PTR)
+
std::auto_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+#else
+
+ std::unique_ptr<lw_abstract_thread> pt( static_cast<lw_abstract_thread *>( pv ) );
+
+#endif
+
pt->run();
return 0;
@@ -117,8 +133,16 @@ private:
template<class F> int lw_thread_create( pthread_t & pt, F f )
{
+#if defined(BOOST_NO_CXX11_SMART_PTR)
+
std::auto_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
+#else
+
+ std::unique_ptr<lw_abstract_thread> p( new lw_thread_impl<F>( f ) );
+
+#endif
+
int r = pthread_create( &pt, 0, lw_thread_routine, p.get() );
if( r == 0 )