Boost logo

Boost Users :

From: he xiang (hexiay_at_[hidden])
Date: 2008-05-20 09:05:17


Hi, all£¬
My code looks like this:

=============================================================

// M is a class, m_show() is one of its methods.

void test_boost_thread_1(){

    M p(88);
    boost::thread pthd(boost::bind(&M::m_show, &p));

}

void test_boost_thread_2(){

    M p(99);
    boost::thread pthd(boost::bind(&M::m_show, &p));

}

===============================================================

"test_boost_thread_1()" and "test_boost_thread_2()" are running at the
same time ,but I find that the output is wrong.
If I changed the thread name "pthd" in "test_boost_thread_()" to other
name , not "pthd" , it looks ok. why ? ........

Now , many other threads want to run " test_boost_thread_1() " at the
"same" time, How could I make it ok ?

Thanks for your time.

Best Regards.



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