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

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - Updating recent updates - Problem in procedure - Any other approach? -