Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r82649 - trunk/libs/thread/test/sync/mutual_exclusion/once/call_once
From: vicente.botet_at_[hidden]
Date: 2013-01-27 16:30:51


Author: viboes
Date: 2013-01-27 16:30:51 EST (Sun, 27 Jan 2013)
New Revision: 82649
URL: http://svn.boost.org/trac/boost/changeset/82649

Log:
Thread: Update win32/once.hpp to take care of variadin rvalu call_once parameters.
Text files modified:
   trunk/libs/thread/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp | 12 +++++++-----
   1 files changed, 7 insertions(+), 5 deletions(-)

Modified: trunk/libs/thread/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp
==============================================================================
--- trunk/libs/thread/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp (original)
+++ trunk/libs/thread/test/sync/mutual_exclusion/once/call_once/call_once_pass.cpp 2013-01-27 16:30:51 EST (Sun, 27 Jan 2013)
@@ -105,15 +105,17 @@
 };
 int init1_member::called = 0;
 
+//#if defined BOOST_THREAD_PLATFORM_PTHREAD
 void f1_member()
 {
     init1_member o;
-#if defined BOOST_THREAD_PLATFORM_PTHREAD && defined BOOST_THREAD_PROVIDES_ONCE_CXX11
+#if defined BOOST_THREAD_PROVIDES_ONCE_CXX11
     boost::call_once(flg1_member, &init1_member::call, o, 1);
 #else
     boost::call_once(flg1_member, boost::bind(&init1_member::call, o, 1));
 #endif
 }
+//#endif
 struct init2
 {
     static int called;
@@ -232,8 +234,7 @@
         t1.join();
         BOOST_TEST(init2::called == 5);
     }
-#if defined BOOST_THREAD_PLATFORM_PTHREAD
- //&& defined BOOST_THREAD_PROVIDES_INVOKE
+
     // check member function with 1 arg
     {
         boost::thread t0(f1_member);
@@ -242,6 +243,7 @@
         t1.join();
         BOOST_TEST(init1_member::called == 1);
     }
+#if defined BOOST_THREAD_PLATFORM_PTHREAD || (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ > 40600)
     {
         boost::once_flag f BOOST_INIT_ONCE_INIT;
         boost::call_once(f, MoveOnly());
@@ -250,8 +252,8 @@
         boost::once_flag f BOOST_INIT_ONCE_INIT;
         boost::call_once(f, MoveOnly(), 1);
     }
-#endif // BOOST_THREAD_PLATFORM_PTHREAD
-#if defined BOOST_THREAD_PLATFORM_PTHREAD && defined BOOST_THREAD_PROVIDES_INVOKE
+#endif
+#if defined BOOST_THREAD_PROVIDES_INVOKE
     {
         boost::once_flag f BOOST_INIT_ONCE_INIT;
         boost::call_once(f, MoveOnly(), MoveOnly());


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