If I correclty understood you I should do smth. similar like this:



boost::mutex m;

struct thread_safety_test
{
    static void thread_function(boost::barrier& b)
    {
        b.wait();
        boost::mutex::scoped_lock lock(m);
        BOOST_CHECK_EQUAL(1,0);
    }

    void test_multiple_assertion_faults()
    {
        boost::thread_group tg;
        boost::barrier b(100);

        for(size_t i=0; i<100; ++i)
        {
            tg.create_thread(boost::bind(thread_function, ref(b)));
        }
    }
};


But unfortunately this does not work. May be I miss smth. here.



With Kind Regards,
Ovanes


On Jan 10, 2008 8:01 PM, Ovanes Markarian <om_boost@keywallet.com> wrote:
Thanks for the answer!

I read some post (mainly: you and William Kempf) about Program Execution Monitor and its MT support. This was in 2002/2003 did you manage to solve these issues?


Many thanks,
Ovanes



On Jan 10, 2008 7:47 PM, Gennadiy Rozental <rogeeff@gmail.com> wrote:
Ovanes Markarian <om_boost <at> keywallet.com> writes:

>
> Hello,is Boost.Test framework thread safe in regards to the following use
case:I would like to start multiple threads with some testing tasks. These
threads will call boost TestTools functions (BOOST_CHECK... etc.). Is this
scenario supported?

No. You will have ti serialize access to the UTF. The simplest way is just use
wrapper macro.

gennadiy

_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users