本文整理汇总了C++中timer_queue类的典型用法代码示例。如果您正苦于以下问题:C++ timer_queue类的具体用法?C++ timer_queue怎么用?C++ timer_queue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了timer_queue类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: cancel_timer
std::size_t select_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
typename timer_queue<Time_Traits>::per_timer_data& timer,
std::size_t max_cancelled)
{
riakboost::asio::detail::mutex::scoped_lock lock(mutex_);
op_queue<operation> ops;
std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
lock.unlock();
io_service_.post_deferred_completions(ops);
return n;
}
开发者ID:4ukuta,项目名称:core,代码行数:11,代码来源:select_reactor.hpp
示例2: cancel_timer
std::size_t epoll_reactor::cancel_timer(timer_queue<Time_Traits>& queue,
typename timer_queue<Time_Traits>::per_timer_data& timer,
std::size_t max_cancelled)
{
mutex::scoped_lock lock(mutex_);
op_queue<operation> ops;
std::size_t n = queue.cancel_timer(timer, ops, max_cancelled);
lock.unlock();
scheduler_.post_deferred_completions(ops);
return n;
}
开发者ID:qxiang88,项目名称:networking-ts-impl,代码行数:11,代码来源:epoll_reactor.hpp
示例3: cancel_timer
std::size_t win_iocp_io_service::cancel_timer(timer_queue<Time_Traits>& queue,
typename timer_queue<Time_Traits>::per_timer_data& timer)
{
// If the service has been shut down we silently ignore the cancellation.
if (::InterlockedExchangeAdd(&shutdown_, 0) != 0)
return 0;
mutex::scoped_lock lock(dispatch_mutex_);
op_queue<win_iocp_operation> ops;
std::size_t n = queue.cancel_timer(timer, ops);
post_deferred_completions(ops);
return n;
}
开发者ID:barrbrain,项目名称:asio,代码行数:13,代码来源:win_iocp_io_service.hpp
示例4: 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
示例5: 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
示例6: 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
示例7: 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类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论