[interprocess] named_condition

The program stops running when it reaches cond.wait(...); This works ok when its compiled on its own but not with the rest of my code. boost::interprocess::named_mutex nm(boost::interprocess::create_only,"STOP_PH_MTX"); boost::interprocess::named_condition cond(boost::interprocess::create_only,"STOP_PH_CND"); boost::interprocess::scoped_lock<boost::interprocess::named_mutex> stop_ph_lock(nm); cond.wait(stop_ph_lock); boost::interprocess::named_mutex::remove("STOP_PH_MTX"); boost::interprocess::named_condition::remove("STOP_PH_CND");

Jan Stetka wrote:
The program stops running when it reaches cond.wait(...); This works ok when its compiled on its own but not with the rest of my code.
boost::interprocess::named_mutex nm(boost::interprocess::create_only,"STOP_PH_MTX");
boost::interprocess::named_condition cond(boost::interprocess::create_only,"STOP_PH_CND");
boost::interprocess::scoped_lock<boost::interprocess::named_mutex> stop_ph_lock(nm);
cond.wait(stop_ph_lock); boost::interprocess::named_mutex::remove("STOP_PH_MTX"); boost::interprocess::named_condition::remove("STOP_PH_CND");
Well, the purpose of a condition variable is to wait another process to call notify(), isn't it? Can you elaborate a bit your question? Regards, Ion

Ion Gaztañaga wrote:
Jan Stetka wrote:
The program stops running when it reaches cond.wait(...); This works ok when its compiled on its own but not with the rest of my code.
boost::interprocess::named_mutex nm(boost::interprocess::create_only,"STOP_PH_MTX");
boost::interprocess::named_condition cond(boost::interprocess::create_only,"STOP_PH_CND");
boost::interprocess::scoped_lock<boost::interprocess::named_mutex> stop_ph_lock(nm);
cond.wait(stop_ph_lock); boost::interprocess::named_mutex::remove("STOP_PH_MTX"); boost::interprocess::named_condition::remove("STOP_PH_CND");
Well, the purpose of a condition variable is to wait another process to call notify(), isn't it? Can you elaborate a bit your question?
Regards,
Ion _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
I get the following when i call wait on the condition. Its throwing an exception. This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.
participants (2)
-
Ion Gaztañaga
-
Jan Stetka