Update of /cvsroot/boost/boost/libs/thread/test
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv12206

Modified Files:
      Tag: thread_rewrite
        test_once.cpp 
Log Message:
Ensure all checks are guarded by a mutex, to avoid race conditions in the test 
library


Index: test_once.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/thread/test/test_once.cpp,v
retrieving revision 1.7.8.3
retrieving revision 1.7.8.4
diff -u -d -r1.7.8.3 -r1.7.8.4
--- test_once.cpp       12 Apr 2006 16:46:10 -0000      1.7.8.3
+++ test_once.cpp       10 Jul 2006 20:53:49 -0000      1.7.8.4
@@ -34,7 +34,9 @@
     for(unsigned i=0;i<loop_count;++i)
     {
         boost::call_once(init_once_value, once);
-        BOOST_CHECK_EQUAL(once_value, 1);
+        int const my_once_value=once_value;
+        boost::mutex::scoped_lock lock(mutex);
+        BOOST_CHECK_EQUAL(my_once_value, 1);
     }
 }
 



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs

Reply via email to