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

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -