int main() { BOOST_TEST( sp.try_lock() ); BOOST_TEST( !sp.try_lock() ); BOOST_TEST( sp2.try_lock() ); BOOST_TEST( !sp.try_lock() ); BOOST_TEST( !sp2.try_lock() ); sp.unlock(); sp2.unlock(); sp.lock(); BOOST_TEST( !sp.try_lock() ); sp2.lock(); BOOST_TEST( !sp.try_lock() ); BOOST_TEST( !sp2.try_lock() ); sp.unlock(); sp2.unlock(); { boost::detail::spinlock::scoped_lock lock( sp ); BOOST_TEST( !sp.try_lock() ); boost::detail::spinlock::scoped_lock lock2( sp2 ); BOOST_TEST( !sp.try_lock() ); BOOST_TEST( !sp2.try_lock() ); } return boost::report_errors(); }
void lock() { HPX_ITT_SYNC_PREPARE(this); m.lock(); HPX_ITT_SYNC_ACQUIRED(this); util::register_lock(this); }
void lock(){ mutex_.lock(); }