当前位置: 首页>>代码示例>>C++>>正文


C++ steady_duration::from_now方法代码示例

本文整理汇总了C++中util::steady_duration::from_now方法的典型用法代码示例。如果您正苦于以下问题:C++ steady_duration::from_now方法的具体用法?C++ steady_duration::from_now怎么用?C++ steady_duration::from_now使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在util::steady_duration的用法示例。


在下文中一共展示了steady_duration::from_now方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: suspend

 /// 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);
 }
开发者ID:avyavkumar,项目名称:hpx,代码行数:24,代码来源:thread_helpers.hpp

示例2: set_thread_state_timed

 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);
 }
开发者ID:akemp,项目名称:hpx,代码行数:7,代码来源:set_thread_state.hpp

示例3: set_thread_state

 ///////////////////////////////////////////////////////////////////////////
 /// \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);
 }
开发者ID:avyavkumar,项目名称:hpx,代码行数:36,代码来源:thread_helpers.hpp

示例4: try_lock_for

 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);
 }
开发者ID:AntonBikineev,项目名称:hpx,代码行数:5,代码来源:mutex.hpp

示例5: wait_until

 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);
 }
开发者ID:HadrienG2,项目名称:hpx,代码行数:6,代码来源:condition_variable.hpp

示例6: wait_for

 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);
 }
开发者ID:HadrienG2,项目名称:hpx,代码行数:5,代码来源:condition_variable.hpp


注:本文中的util::steady_duration::from_now方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。