|
Electroneum
|
#include <task_region.h>

Classes | |
| struct | state |
| struct | wrapper |
Public Member Functions | |
| task_region_handle ()=delete | |
| task_region_handle (const task_region_handle &)=delete | |
| task_region_handle (task_region_handle &&)=delete | |
| ~task_region_handle () noexcept | |
| Cancels unstarted pending tasks, and waits for them to respond. More... | |
| task_region_handle & | operator= (const task_region_handle &)=delete |
| task_region_handle & | operator= (task_region_handle &&)=delete |
| template<typename F > | |
| void | run (F &&f) |
| void | wait () noexcept |
Wait until all functions provided to run have completed. More... | |
Private Member Functions | |
| task_region_handle (thread_group &threads_src) | |
| void | create_state () |
| void | do_wait () noexcept |
Private Attributes | |
| std::shared_ptr< state > | st |
| thread_group & | threads |
| state::id | next_id |
Friends | |
| struct | task_region_ |
A model of the fork-join concept. run(...) "forks" (i.e. spawns new tasks), and ~task_region_handle() or wait() "joins" the spawned tasks. wait will block until all tasks have completed, while ~task_region_handle() blocks until all tasks have completed or aborted.
Do NOT give this object to separate thread of execution (which includes task_region_handle::run(...)) because joining on a different thread is undesireable (potential deadlock).
This class cannot be constructed directly, use the function task_region(...) instead.
|
delete |
|
delete |
|
delete |
|
inlinenoexcept |
Cancels unstarted pending tasks, and waits for them to respond.
|
inlineexplicitprivate |
|
private |
|
privatenoexcept |
|
delete |
|
delete |
|
inline |
If the group has no threads, f is immediately run before returning. Otherwise, f is dispatched to the thread_group associated with this region. If f is dispatched to another thread, and it throws, the process will immediately terminate. See std::packaged_task for getting exceptions on functions executed on other threads.
|
inlinenoexcept |
Wait until all functions provided to run have completed.
|
friend |
|
private |
|
private |
|
private |
1.8.14