| 235 | if (_disposed || !hasTask) { |
| 236 | *shouldRun = false; |
| 237 | } else { |
| 238 | nextTaskFunction = std::move(_tasks.front().function); |
| 239 | *parentSpanId = _tasks.front().parentSpanId; |
| 240 | _currentRunningTasks++; |
| 241 | _tasks.pop_front(); |
| 242 | } |
| 243 | return nextTaskFunction; |
| 244 | } |
| 245 | |
| 246 | size_t TaskQueue::flush() { |
| 247 | size_t ranTasks = 0; |