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

Method _execute

src/bthread/execution_queue.cpp:302–326  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302int ExecutionQueueBase::_execute(TaskNode* head, bool high_priority, int* niterated) {
303 if (head != NULL && head->stop_task) {
304 CHECK(head->next == NULL);
305 head->iterated = true;
306 head->status = TaskNode::EXECUTED;
307 TaskIteratorBase iter(NULL, this, true, false);
308 _execute_func(_meta, _type_specific_function, iter);
309 if (niterated) {
310 *niterated = 1;
311 }
312 return ESTOP;
313 }
314 TaskIteratorBase iter(head, this, false, high_priority);
315 if (iter) {
316 _execute_func(_meta, _type_specific_function, iter);
317 }
318 // We must assign |niterated| with num_iterated even if we couldn't peek
319 // any task to execute at the begining, in which case all the iterated
320 // tasks have been cancelled at this point. And we must return the
321 // correct num_iterated() to the caller to update the counter correctly.
322 if (niterated) {
323 *niterated = iter.num_iterated();
324 }
325 return 0;
326}
327
328TaskNode* ExecutionQueueBase::allocate_node() {
329 get_execq_vars()->running_task_count << 1;

Callers 1

_execute_tasksMethod · 0.80

Calls 1

num_iteratedMethod · 0.80

Tested by

no test coverage detected