Exemplo n.º 1
0
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();
}
Exemplo n.º 2
0
 void unlock()
 {
     HPX_ITT_SYNC_RELEASING(this);
     m.unlock();
     HPX_ITT_SYNC_RELEASED(this);
     util::unregister_lock(this);
 }
Exemplo n.º 3
0
		void unlock(){
			mutex_.unlock();
		}