problem in threading c++ -
i running 2 threads , text display first displayed after execution of thread
string thread(string url) { mutex.lock(); //some function goes here mutex.unlock(); } int main() { cout<<"asd"; boost::thread t1(boost::bind(&thread)); boost::thread t2(boost::bind(&thread)); t1.join(); t2.join(); }
in main program have displayed text asd
displayed after execution of thread ..
std::cout << "asd" << std::flush;
Comments
Post a Comment