예제 #1
0
 void wait_until_with_predicate()
 {
     boost::system_time const timeout=boost::get_system_time()+boost::posix_time::seconds(5);
     boost::unique_lock<hpx::lcos::local::spinlock> lock(mutex);
     if(cond_var.wait_until(lock,timeout,check_flag(flag)) && flag)
     {
         ++woken;
     }
 }
예제 #2
0
    void wait_until_with_predicate()
    {
        boost::chrono::system_clock::time_point const timeout =
            boost::chrono::system_clock::now() + boost::chrono::milliseconds(5);

        boost::unique_lock<hpx::lcos::local::spinlock> lock(mutex);
        if(cond_var.wait_until(lock,timeout,check_flag(flag)) && flag)
        {
            ++woken;
        }
    }
예제 #3
0
    void wait_until_without_predicate()
    {
        boost::system_time const timeout=boost::get_system_time()+boost::posix_time::seconds(5);

        boost::unique_lock<hpx::lcos::local::spinlock> lock(mutex);
        while(!flag)
        {
            if(cond_var.wait_until(lock,timeout) == hpx::lcos::local::cv_status::timeout)
            {
                return;
            }
        }
        ++woken;
    }
예제 #4
0
    void wait_until_without_predicate()
    {
        boost::chrono::system_clock::time_point const timeout =
            boost::chrono::system_clock::now() + boost::chrono::milliseconds(5);

        boost::unique_lock<hpx::lcos::local::spinlock> lock(mutex);
        while(!flag)
        {
            if(cond_var.wait_until(lock,timeout) == hpx::lcos::local::cv_status::timeout)
            {
                return;
            }
        }
        ++woken;
    }