⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ptimerdispatcher.cpp

📁 ACE自适配通信环境(ADAPTIVE Communication Environment)是可以自由使用、开放源码的面向对象(OO)框架(Framework)
💻 CPP
字号:
// PTimerDispatcher.cpp,v 1.3 2004/06/13 17:02:04 jwillemsen Exp#include "PTimerDispatcher.h"void PTimer_Dispatcher::wait_for_event (void){  ACE_TRACE (ACE_TEXT ("PTimer_Dispatcher::wait_for_event"));  while (1)    {      ACE_Time_Value max_tv = timer_queue_->gettimeofday ();      ACE_Time_Value *this_timeout =        this->timer_queue_->calculate_timeout (&max_tv);      if (*this_timeout == ACE_Time_Value::zero)        this->timer_queue_->expire ();      else        {          // Convert to absolute time.          ACE_Time_Value next_timeout =            timer_queue_->gettimeofday ();          next_timeout += *this_timeout;          if (this->timer_.wait (&next_timeout) == -1 )            this->timer_queue_->expire ();        }    }}longPTimer_Dispatcher::schedule (PCB *cb,                             void *arg,                             const ACE_Time_Value &abs_time,                             const ACE_Time_Value &interval){  ACE_TRACE (ACE_TEXT ("PTimer_Dispatcher::schedule_timer"));  return this->timer_queue_->schedule    (cb, arg, abs_time, interval);}intPTimer_Dispatcher::cancel (PCB *cb,                           int dont_call_handle_close){  ACE_TRACE (ACE_TEXT ("PTimer_Dispatcher::cancel"));  return timer_queue_->cancel (cb, dont_call_handle_close);}void PTimer_Dispatcher::set (PTimerQueue *timer_queue){  ACE_TRACE (ACE_TEXT ("PTimer_Dispatcher::set"));  timer_queue_ = timer_queue;}intPTimer_Dispatcher::reset_interval (long timer_id,                                   const ACE_Time_Value &interval){  ACE_TRACE (ACE_TEXT ("PTimer_Dispatcher::reset_interval"));  return timer_queue_->reset_interval (timer_id, interval);}#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION)template class ACE_Singleton <PTimer_Dispatcher, ACE_Null_Mutex>;#elif defined (ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA)#pragma instantiate ACE_Singleton <PTimer_Dispatcher, ACE_Null_Mutex>#elif defined (ACE_HAS_EXPLICIT_STATIC_TEMPLATE_MEMBER_INSTANTIATION)template ACE_Singleton<PTimer_Dispatcher, ACE_Null_Mutex> *      ACE_Singleton<PTimer_Dispatcher, ACE_Null_Mutex>::singleton_;# endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -