Home
last modified time | relevance | path

Searched refs:timerFd (Results 1 - 7 of 7) sorted by relevance

/commonlibrary/c_utils/base/src/
H A Dtimer.cpp86 int timerFd = once ? INVALID_TIMER_FD : GetTimerFd(interval); in Register() local
87 if (timerFd == INVALID_TIMER_FD) { in Register()
88 uint32_t ret = DoRegister([this](int fd) { this->OnTimer(fd); }, interval, once, timerFd); in Register()
106 entry->timerFd = timerFd; in Register()
131 reactor_->CancelTimer((*itor)->timerFd); in Unregister()
132 timers_.erase((*itor)->timerFd); in Unregister()
156 uint32_t Timer::DoRegister(const TimerListCallback& callback, uint32_t interval, bool once, int &timerFd) in DoRegister() argument
159 uint32_t ret = reactor_->ScheduleTimer(cb, interval, timerFd, once); in DoRegister()
160 if ((ret != TIMER_ERR_OK) || (timerFd < in DoRegister()
177 OnTimer(int timerFd) OnTimer() argument
208 DoTimerListCallback(const TimerListCallback& callback, int timerFd) DoTimerListCallback() argument
[all...]
H A Devent_reactor.cpp98 uint32_t EventReactor::ScheduleTimer(const TimerCallback& cb, uint32_t interval, int& timerFd, bool once) in ScheduleTimer() argument
109 timerFd = handler->GetHandle(); in ScheduleTimer()
114 void EventReactor::CancelTimer(int timerFd) in CancelTimer() argument
116 UTILS_LOGD("Cancel timer, timerFd: %{public}d.", timerFd); in CancelTimer()
120 if ((*itor)->GetHandle() == timerFd) { in CancelTimer()
H A Devent_reactor.h36 using TimerCallback = std::function<void(int timerFd)>;
69 uint32_t ScheduleTimer(const TimerCallback& cb, uint32_t interval /* ms */, int& timerFd, bool once);
70 void CancelTimer(int timerFd);
H A Dtimer_event_handler.h30 using TimerCallback = std::function<void(int timerFd)>;
/commonlibrary/c_utils/base/include/
H A Dtimer.h53 using TimerListCallback = std::function<void (int timerFd)>;
118 void OnTimer(int timerFd);
119 virtual uint32_t DoRegister(const TimerListCallback& callback, uint32_t interval, bool once, int &timerFd);
121 void DoTimerListCallback(const TimerListCallback& callback, int timerFd);
132 int timerFd; member
/commonlibrary/c_utils/base/test/benchmarktest/event_benchmark_test/
H A Devent_benchmark_test.cpp381 BENCHMARK_LOGD("Set timerFd failed-%{public}s timer_fd:%{public}d", strerror(errno), GetFd()); in Initialize()
680 TimerEventHandler(int timerFd, uint32_t timeout, bool once);
741 ErrCode ScheduleTimer(const TimerEventCallback& callback, uint32_t interval, uint32_t timerId, int& timerFd,
813 uint32_t timerId, int& timerFd, bool once) in ScheduleTimer()
816 std::shared_ptr<TimerEventHandler> handler = std::make_shared<TimerEventHandler>(timerFd, interval, once); in ScheduleTimer()
817 BENCHMARK_LOGD("Timer::ScheduleTimer interval: %{public}u -- timerId: %{public}u -- timerFd: %{public}d", in ScheduleTimer()
818 interval, timerId, timerFd); in ScheduleTimer()
834 timerFd = handler->GetTimerFd(); in ScheduleTimer()
846 int timerFd = once ? IO_EVENT_INVALID_FD : GetTimerFd(interval); // Get timerFd in Register() local
812 ScheduleTimer(const TimerEventCallback& callback, uint32_t interval, uint32_t timerId, int& timerFd, bool once) ScheduleTimer() argument
947 TimerEventHandler(int timerFd, uint32_t timeout , bool once) TimerEventHandler() argument
[all...]
/commonlibrary/c_utils/base/test/unittest/common/
H A Dutils_event_test.cpp279 std::cout << "Set timerFd failed-" << strerror(errno) << "timer_fd:" << GetFd() << ", next_time:" << in Initialize()
548 TimerEventHandler(int timerFd, uint32_t timeout, bool once);
610 ErrCode ScheduleTimer(const TimerEventCallback& callback, uint32_t interval, uint32_t timerId, int& timerFd,
678 int& timerFd, bool once) in ScheduleTimer()
680 std::shared_ptr<TimerEventHandler> handler = std::make_shared<TimerEventHandler>(timerFd, interval, once); in ScheduleTimer()
696 timerFd = handler->GetTimerFd(); in ScheduleTimer()
707 int timerFd = once ? IO_EVENT_INVALID_FD : GetTimerFd(interval); // Get timerFd in Register() local
710 uint32_t ret = ScheduleTimer(wrappedCb, interval, timerId, timerFd, once); in Register()
713 timerId << ", interval:" << interval << "timer-fd:" << timerFd << st in Register()
677 ScheduleTimer(const TimerEventCallback& callback, uint32_t interval, uint32_t timerId, int& timerFd, bool once) ScheduleTimer() argument
806 TimerEventHandler(int timerFd, uint32_t timeout , bool once) TimerEventHandler() argument
[all...]

Completed in 5 milliseconds