Skip to main content

luaur_analyze_cli/methods/
task_scheduler_worker_function.rs

1use crate::records::task_scheduler::TaskQueue;
2
3/// `void workerFunction()` (`CLI/src/Analyze.cpp:381-385`):
4///
5/// ```cpp
6/// while (std::function<void()> task = pop())
7///     task();
8/// ```
9/// An empty `std::function` (modeled as `None`) is falsy and terminates the loop.
10pub fn task_scheduler_worker_function(tasks: &TaskQueue) {
11    while let Some(task) = crate::methods::task_scheduler_pop::task_scheduler_pop(tasks) {
12        task();
13    }
14}