Exemplo n.º 1
0
void Timer::run(TaskContextPtr taskContextPtr, const boost::system::error_code& e){
	if(e == boost::asio::error::operation_aborted){
		return ;
	}
	taskContextPtr->func_();
	if(taskContextPtr->mode == 1){
		TimerPtr  timerPtr = taskContextPtr->timerPtr_;
		timerPtr->expires_at(timerPtr->expires_at() + boost::posix_time::millisec(taskContextPtr->deadline_time));
		timerPtr->async_wait(taskContextPtr->strand_.wrap(bind(&Timer::run, this, taskContextPtr, placeholders::error)));
	}else{

	}
}