<br><br><div class="gmail_quote">On Jan 10, 2008 8:48 PM, Gennadiy Rozental <<a href="mailto:rogeeff@gmail.com">rogeeff@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d">Ovanes Markarian <om_boost <at> <a href="http://keywallet.com" target="_blank">keywallet.com</a>> writes:<br></div><div class="Ih2E3d">> struct thread_safety_test<br>> {<br>> static void thread_function(boost::barrier& b) <br>> {<br>> b.wait();<br><br></div>Can't comment in these. I never used this class.<br><div class="Ih2E3d"><br>| boost::mutex::scoped_lock lock(m);<br>| BOOST_CHECK_EQUAL(1,0);<br>| } <br>|<br>| void test_multiple_assertion_faults()<br>| {<br>| boost::thread_group tg;<br>| boost::barrier b(100);<br>|<br>| for(size_t i=0; i<100; ++i)<br>| {<br>| tg.create_thread (boost::bind(thread_function, ref(b)));<br>| }<br>| }<br>| };<br>| But unfortunately this does not work. May be I miss smth. here.<br><br></div>>I am not an expert in MT, but what exactly is the problem?<br> ><br>>Do you run is from inside the test case?<br><br><br>Yes. The class specified is passed to the <span>BOOST_CLASS_TEST_CASE</span>( multiple_assertion_faults, thread_safety_test) <br> <br> The idea of my code is:<br> Create 100 threads and wait until all of them are created. (barrier is used for that).<br> <br> After all threads were created lock the mutex and produce the assertion fault. In MSVC 7.1 this code crashes after the second call to BOOST_CHECK_EQUAL.<br> <br> <br> I thought you would be aware of this issue.<br> <br> <br> Many thanks for your help!<br> Ovanes<br> <br> <div><div class="Wj3C7c"><br></div></div></blockquote></div>