
On Mon, Jul 9, 2012 at 11:58 AM, Joseph Van Riper < fleeb.fantastique@gmail.com> wrote:
int _tmain(int argc, _TCHAR* argv[]) { boost::interprocess::named_mutex mutex( boost::interprocess::open_or_create, "test" ); boost::interprocess::named_condition condition( boost::interprocess::open_or_create, "test" ); condition.wait( mutex ); return 0; }
I see now that I am using a naked boost::interprocess::named_mutex when I should use a boost::interprocess::scoped_lock around it instead, as: int _tmain(int argc, _TCHAR* argv[]) { boost::interprocess::named_mutex mutex( boost::interprocess::open_or_create, "test" ); boost::interprocess::named_condition condition( boost::interprocess::open_or_create, "test" ); boost::interprocess::scoped_lock< boost::interprocess::named_mutex
lock( mutex ); condition.wait( lock ); return 0; }
- Trey