MCPcopy Create free account
hub / github.com/apache/brpc / RunPeriodicTaskThread

Function RunPeriodicTaskThread

src/brpc/periodic_task.cpp:39–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37}
38
39static 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
52void PeriodicTaskManager::StartTaskAt(PeriodicTask* task, const timespec& abstime) {
53 if (task == NULL) {

Callers

nothing calls this directly

Calls 3

bthread_attr_set_nameFunction · 0.85
bthread_start_backgroundFunction · 0.85
OnDestroyingTaskMethod · 0.80

Tested by

no test coverage detected