Template Function concore::v1::spawn_and_wait(F&&)

Function Documentation

template<typename F>
void concore::v1::spawn_and_wait(F &&ftor)

Spawn a task and wait for it.

This function is similar to the

spawn() functions, but, after spawning, also waits for the spawned task to complete. This wait is an active-wait, as it tries to execute other tasks. In principle, the current thread executes the spawn task.
Parameters
  • ftor: The functor of the tasks to be spawned

Template Parameters
  • F: The type of the functor.

This will create a new task group, inheriting from the task group of the currently executing task and add the new task in this new group. The waiting is done on this new group.

See

spawn()