| 37 | } |
| 38 | |
| 39 | static void RunPeriodicTaskThread(void* arg) { |
| 40 | bthread_t th = 0; |
| 41 | bthread_attr_t attr = BTHREAD_ATTR_NORMAL; |
| 42 | bthread_attr_set_name(&attr, "PeriodicTaskThread"); |
| 43 | int rc = bthread_start_background( |
| 44 | &th, &attr, PeriodicTaskThread, arg); |
| 45 | if (rc != 0) { |
| 46 | LOG(ERROR) << "Fail to start PeriodicTaskThread"; |
| 47 | static_cast<PeriodicTask*>(arg)->OnDestroyingTask(); |
| 48 | return; |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | void PeriodicTaskManager::StartTaskAt(PeriodicTask* task, const timespec& abstime) { |
| 53 | if (task == NULL) { |
nothing calls this directly
no test coverage detected