Boost logo

Boost Users :

Subject: [Boost-users] Is boost test thread-safe?
From: edA-qa mort-ora-y (eda-qa_at_[hidden])
Date: 2011-04-24 09:00:16


I searched a bit but was unable to find a reasonable answer. Is the test
framework thread-safe? I am asking since when I do threaded tests I get
weird and seemingly random output.

By thread-safe I don't mean that I have multiple tests running at the
same time, but simply that I have tests which involve multiple threads.
 For example:

BOOST_AUTO_TEST_CASE( threaded )
{
  thread a( func_a );
  thread b( func_b );

  a.join();
  b.join();
}

void func_a()
{
  ...
  BOOST_CHECK_EQUAL( 123, var );
}

It appears that using the BOOST_CHECK tools from the thread causes problems.

-- 
edA-qa mort-ora-y
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Sign: Please digitally sign your emails.
Encrypt: I'm also happy to receive encrypted mail.



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net