DepSpawn 1.2
 
Loading...
Searching...
No Matches
depspawn::Observer Class Reference

When destroyed, it makes sure that all the tasks spawned by the current thread since its creation have finished. More...

#include <depspawn.h>

Public Member Functions

 Observer (bool priority=true)
 

Friends

void wait_for_subtasks (bool priority)
 

Detailed Description

When destroyed, it makes sure that all the tasks spawned by the current thread since its creation have finished.

A typical pattern of use for an Observer is

spawn(...);
spawn(...);
}
When destroyed, it makes sure that all the tasks spawned by the current thread since its creation hav...
Definition: depspawn.h:693

which makes sure that the two spawned tasks have finished before leaving the block.

Constructor & Destructor Documentation

◆ Observer()

depspawn::Observer::Observer ( bool  priority = true)

Constructor

Parameters
priorityif true, the observer will only collaborate in the execution of pending tasks found in the critical path since its creation. Otherwise, if it is idle because all those tasks are already running or waiting for dependencies, it can run other tasks while it waits.

Friends And Related Function Documentation

◆ wait_for_subtasks

void wait_for_subtasks ( bool  priority)
friend

Waits for all the subtasks of the current task to finish

Parameters
priorityif true, the thread will only execute subtasks it depends on during the wait. Otherwise, if it is idle because all those tasks are already running or waiting for dependencies, it can run other tasks while it waits.

The documentation for this class was generated from the following file: