Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r53874 - in sandbox/task: boost/task/detail libs/task/test
From: oliver.kowalke_at_[hidden]
Date: 2009-06-13 15:27:58


Author: olli
Date: 2009-06-13 15:27:58 EDT (Sat, 13 Jun 2009)
New Revision: 53874
URL: http://svn.boost.org/trac/boost/changeset/53874

Log:
* fixes for atomic ops. on windows
* fixes on test for windows
Text files modified:
   sandbox/task/boost/task/detail/atomic_interlocked.hpp | 8 ++++----
   sandbox/task/libs/task/test/test_functions.hpp | 15 ++++++++++++++-
   2 files changed, 18 insertions(+), 5 deletions(-)

Modified: sandbox/task/boost/task/detail/atomic_interlocked.hpp
==============================================================================
--- sandbox/task/boost/task/detail/atomic_interlocked.hpp (original)
+++ sandbox/task/boost/task/detail/atomic_interlocked.hpp 2009-06-13 15:27:58 EDT (Sat, 13 Jun 2009)
@@ -9,7 +9,7 @@
 
 #include <boost/assert.hpp>
 #include <boost/cstdint.hpp>
-#include <boost/detail/detail/interlocked.hpp>
+#include <boost/detail/interlocked.hpp>
 
 #include <boost/config/abi_prefix.hpp>
 
@@ -19,20 +19,20 @@
 {
 inline
 void atomic_exchange( uint32_t volatile * object, uint32_t desired)
-{ BOOST_INTERLOCKED_EXCHANGE( object, desired); }
+{ BOOST_INTERLOCKED_EXCHANGE( reinterpret_cast< long volatile * >( object), desired); }
 
 inline
 uint32_t atomic_fetch_add( uint32_t volatile * object, uint32_t operand)
 {
         BOOST_ASSERT( operand == 1);
- return BOOST_INTERLOCKED_INCREMENT( object);
+ return BOOST_INTERLOCKED_INCREMENT( reinterpret_cast< long volatile * >( object) );
 }
 
 inline
 uint32_t atomic_fetch_sub( uint32_t volatile * object, uint32_t operand)
 {
         BOOST_ASSERT( operand == 1);
- return BOOST_INTERLOCKED_DECREMENT( object);
+ return BOOST_INTERLOCKED_DECREMENT( reinterpret_cast< long volatile * >( object) );
 }
 } } }
 

Modified: sandbox/task/libs/task/test/test_functions.hpp
==============================================================================
--- sandbox/task/libs/task/test/test_functions.hpp (original)
+++ sandbox/task/libs/task/test/test_functions.hpp 2009-06-13 15:27:58 EDT (Sat, 13 Jun 2009)
@@ -13,9 +13,16 @@
 #include <stdexcept>
 #include <vector>
 
+#include <boost/task/detail/config.hpp>
+
 extern "C"
 {
+#if defined( BOOST_POSIX_API)
 #include <unistd.h>
+# endif
+# if defined( BOOST_WINDOWS_API)
+#include <windows.h>
+# endif
 }
 
 #include <boost/bind.hpp>
@@ -40,7 +47,13 @@
 { boost::this_thread::sleep( td); }
 
 void non_interrupt_fn( int sec)
-{ ::sleep( sec); }
+{
+# if defined( BOOST_WINDOWS_API)
+ ::Sleep( sec * 1000);
+# else
+ ::sleep( sec);
+# endif
+}
 
 void interrupt_fn( pt::time_duration const& td, bool & finished)
 {


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