|
发表于 2010-12-29 17:11:35
|
显示全部楼层
回复 2# freeeyes
typedef ACE_Thread_Timer_Queue_Adapter<ACE_Timer_Heap> ActiveTimer;
ActiveTimer就是你的定时器,你可以调用(比如)
ActiveTimer objActiveTimer;
objActiveTimer.schedule(this, NULL, ACE_Time_Value(MAX_MSG_STARTTIME), ACE_Time_Value(m_u2ThreadTimeCheck));
疑问?? 你传的模板参数是ACE_Timer_Heap , ACE_Timer_Heap只提供的是schedule_i 接口,ACE_Thread_Timer_Queue_Adapter<TQ>::schedule函数实现里调用的是schedule(见下面注释部分), 所以 这样用法 应该有问题的啊?
而template<class TQ> long
ACE_Thread_Timer_Queue_Adapter<TQ>::schedule
(ACE_Event_Handler* handler,
const void *act,
const ACE_Time_Value &future_time,
const ACE_Time_Value &interval)
{
ACE_GUARD_RETURN (ACE_SYNCH_RECURSIVE_MUTEX, guard, this->mutex_, -1);
long const result = this->timer_queue_->schedule (handler, act, future_time, interval); //这里调用的是schedule 接口啊
this->condition_.signal ();
return result;
} |
|