コード例 #1
0
ファイル: thread_helpers.hpp プロジェクト: avyavkumar/hpx
 /// The function \a suspend will return control to the thread manager
 /// (suspends the current thread). It sets the new state of this thread
 /// to \a suspended and schedules a wakeup for this threads after the given
 /// duration.
 ///
 /// \note Must be called from within a HPX-thread.
 ///
 /// \throws If <code>&ec != &throws</code>, never throws, but will set \a ec
 ///         to an appropriate value when an error occurs. Otherwise, this
 ///         function will throw an \a hpx#exception with an error code of
 ///         \a hpx#yield_aborted if it is signaled with \a wait_aborted.
 ///         If called outside of a HPX-thread, this function will throw
 ///         an \a hpx#exception with an error code of \a hpx::null_thread_id.
 ///         If this function is called while the thread-manager is not
 ///         running, it will throw an \a hpx#exception with an error code of
 ///         \a hpx#invalid_status.
 ///
 inline threads::thread_state_ex_enum suspend(
     util::steady_duration const& rel_time,
     char const* description = "this_thread::suspend",
     error_code& ec = throws)
 {
     return suspend(rel_time.from_now(), description, ec);
 }
コード例 #2
0
ファイル: set_thread_state.hpp プロジェクト: akemp/hpx
 thread_id_type set_thread_state_timed(SchedulingPolicy& scheduler,
     util::steady_duration const& rel_time, thread_id_type const& thrd,
     error_code& ec)
 {
     return set_thread_state_timed(scheduler, rel_time.from_now(), thrd, 
         pending, wait_timeout, thread_priority_normal, std::size_t(-1), ec);
 }
コード例 #3
0
ファイル: set_thread_state.hpp プロジェクト: akemp/hpx
 thread_id_type set_thread_state_timed(SchedulingPolicy& scheduler,
     util::steady_duration const& rel_time, thread_id_type const& thrd,
     thread_state_enum newstate, thread_state_ex_enum newstate_ex,
     thread_priority priority, std::size_t thread_num, error_code& ec)
 {
     return set_thread_state_timed(scheduler, rel_time.from_now(), thrd,
         newstate, newstate_ex, priority, thread_num, ec);
 }
コード例 #4
0
ファイル: thread_helpers.hpp プロジェクト: avyavkumar/hpx
 ///////////////////////////////////////////////////////////////////////////
 /// \brief  Set the thread state of the \a thread referenced by the
 ///         thread_id \a id.
 ///
 /// Set a timer to set the state of the given \a thread to the given
 /// new value after it expired (after the given duration)
 ///
 /// \param id         [in] The thread id of the thread the state should
 ///                   be modified for.
 /// \param after_duration
 /// \param state      [in] The new state to be set for the thread
 ///                   referenced by the \a id parameter.
 /// \param state_ex   [in] The new extended state to be set for the
 ///                   thread referenced by the \a id parameter.
 /// \param priority
 /// \param ec         [in,out] this represents the error status on exit,
 ///                   if this is pre-initialized to \a hpx#throws
 ///                   the function will throw on error instead.
 ///
 /// \returns
 ///
 /// \note             As long as \a ec is not pre-initialized to
 ///                   \a hpx#throws this function doesn't
 ///                   throw but returns the result code using the
 ///                   parameter \a ec. Otherwise it throws an instance
 ///                   of hpx#exception.
 inline thread_id_type set_thread_state(thread_id_type const& id,
     util::steady_duration const& rel_time,
     thread_state_enum state = pending,
     thread_state_ex_enum stateex = wait_timeout,
     thread_priority priority = thread_priority_normal,
     error_code& ec = throws)
 {
     return set_thread_state(id, rel_time.from_now(), state, stateex,
         priority, ec);
 }
コード例 #5
0
ファイル: mutex.hpp プロジェクト: AntonBikineev/hpx
 bool try_lock_for(util::steady_duration const& rel_time,
     char const* description, error_code& ec = throws)
 {
     return try_lock_until(rel_time.from_now(), description, ec);
 }
コード例 #6
0
ファイル: condition_variable.hpp プロジェクト: HadrienG2/hpx
 cv_status
 wait_for(Lock& lock, util::steady_duration const& rel_time,
     error_code& ec = throws)
 {
     return wait_until(lock, rel_time.from_now(), ec);
 }
コード例 #7
0
ファイル: condition_variable.hpp プロジェクト: HadrienG2/hpx
 bool wait_for(Lock& lock, util::steady_duration const& rel_time,
     Predicate pred, error_code& ec = throws)
 {
     return wait_until(lock, rel_time.from_now(), std::move(pred), ec);
 }