示例#1
0
void receive_result(boost::int32_t i)
{
    hpx::util::spinlock::scoped_lock l(result_mutex);
    if (i > final_result)
        final_result = i;
    result_cv.notify_one();
}
示例#2
0
    void locking_thread_through_constructor()
    {
        Lock lock(m,boost::chrono::milliseconds(50));

        boost::lock_guard<hpx::lcos::local::mutex> lk(done_mutex);
        locked=lock.owns_lock();
        done=true;
        done_cond.notify_one();
    }
示例#3
0
    void locking_thread()
    {
        Lock lock(m,boost::defer_lock);
        lock.try_lock_for(boost::chrono::milliseconds(50));

        boost::lock_guard<hpx::lcos::local::mutex> lk(done_mutex);
        locked=lock.owns_lock();
        done=true;
        done_cond.notify_one();
    }