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


C++ timer_queue::enqueue_timer方法代码示例

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


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

示例1: schedule_timer

void epoll_reactor::schedule_timer(timer_queue<Time_Traits>& queue,
    const typename Time_Traits::time_type& time,
    typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op)
{
  mutex::scoped_lock lock(mutex_);

  if (shutdown_)
  {
    io_service_.post_immediate_completion(op, false);
    return;
  }

  bool earliest = queue.enqueue_timer(time, timer, op);
  io_service_.work_started();
  if (earliest)
    update_timeout();
}
开发者ID:GeorgeShaw,项目名称:resiprocate,代码行数:17,代码来源:epoll_reactor.hpp

示例2: schedule_timer

void kqueue_reactor::schedule_timer(timer_queue<Time_Traits>& queue,
    const typename Time_Traits::time_type& time,
    typename timer_queue<Time_Traits>::per_timer_data& timer, timer_op* op)
{
  boost::asio::detail::mutex::scoped_lock lock(mutex_);

  if (shutdown_)
  {
    io_service_.post_immediate_completion(op);
    return;
  }

  bool earliest = queue.enqueue_timer(time, timer, op);
  io_service_.work_started();
  if (earliest)
    interrupter_.interrupt();
}
开发者ID:Skovpin,项目名称:CodeBlocks-RG,代码行数:17,代码来源:kqueue_reactor.hpp

示例3: schedule_timer

void winrt_timer_scheduler::schedule_timer(timer_queue<Time_Traits>& queue,
    const typename Time_Traits::time_type& time,
    typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op)
{
  boost::asio::detail::mutex::scoped_lock lock(mutex_);

  if (shutdown_)
  {
    io_service_.post_immediate_completion(op, false);
    return;
  }

  bool earliest = queue.enqueue_timer(time, timer, op);
  io_service_.work_started();
  if (earliest)
    event_.signal(lock);
}
开发者ID:8c6794b6,项目名称:supercollider,代码行数:17,代码来源:winrt_timer_scheduler.hpp

示例4: schedule_timer

void win_iocp_io_service::schedule_timer(timer_queue<Time_Traits>& queue,
    const typename Time_Traits::time_type& time,
    typename timer_queue<Time_Traits>::per_timer_data& timer, wait_op* op)
{
  // If the service has been shut down we silently discard the timer.
  if (::InterlockedExchangeAdd(&shutdown_, 0) != 0)
  {
    post_immediate_completion(op, false);
    return;
  }

  mutex::scoped_lock lock(dispatch_mutex_);

  bool earliest = queue.enqueue_timer(time, timer, op);
  work_started();
  if (earliest)
    update_timeout();
}
开发者ID:Sandern,项目名称:py-source-sdk-2013,代码行数:18,代码来源:win_iocp_io_service.hpp


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