Spec-Zone.ru › C++

std::execution::run_loop::run

void run() noexcept;
(since C++26)

Runs work queued in the run_loop on the calling thread.

Preconditions

The run_loop instance's state is either starting or finishing.

Effects

If the run_loop instance's state is starting, changes the state to running. Otherwise, leaves the state unchanged.

Then repeatedly removes the first queued operation state and executes it, as if by:

while (auto* op = pop-front())
    op->execute();

The internal pop-front operation blocks until either a work item is available, or the loop's count is 0 and its state is finishing. In the latter case, it changes the state to finished and causes run to return.

Example

© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/cpp/execution/run_loop/run

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API