| 50 | } |
| 51 | |
| 52 | void PeriodicTaskManager::StartTaskAt(PeriodicTask* task, const timespec& abstime) { |
| 53 | if (task == NULL) { |
| 54 | LOG(ERROR) << "Param[task] is NULL"; |
| 55 | return; |
| 56 | } |
| 57 | bthread_timer_t timer_id; |
| 58 | const int rc = bthread_timer_add( |
| 59 | &timer_id, abstime, RunPeriodicTaskThread, task); |
| 60 | if (rc != 0) { |
| 61 | LOG(ERROR) << "Fail to add timer for RunPerodicTaskThread"; |
| 62 | task->OnDestroyingTask(); |
| 63 | return; |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | } // namespace brpc |
nothing calls this directly
no test coverage detected