MCPcopy Create free account
hub / github.com/acl-dev/acl / set_task

Method set_task

lib_acl_cpp/src/stream/aio_timer_callback.cpp:114–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

112}
113
114acl_int64 aio_timer_callback::set_task(unsigned int id, acl_int64 delay)
115{
116 aio_timer_task* task = NULL;
117 std::list<aio_timer_task*>::iterator it = tasks_.begin();
118 for (; it != tasks_.end(); ++it) {
119 if ((*it)->id == id) {
120 task = (*it);
121 tasks_.erase(it);
122 length_--;
123 break;
124 }
125 }
126
127 if (task == NULL) {
128 task = NEW aio_timer_task();
129 task->delay = delay;
130 task->id = id;
131 } else {
132 task->delay = delay;
133 }
134
135 return set_task(task);
136}
137
138acl_int64 aio_timer_callback::set_task(aio_timer_task* task)
139{

Callers 1

set_timerMethod · 0.45

Calls 5

beginMethod · 0.80
insertMethod · 0.80
aio_timer_taskClass · 0.70
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected