MeshLib C++ Docs
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
MRTbbTaskArenaAndGroup.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRPch/MRTBB.h"
4#include "MRPch/MRBindingMacros.h"
5
6namespace MR
7{
8
12struct MR_BIND_IGNORE TbbTaskArenaAndGroup
13{
14 tbb::task_arena arena;
15 tbb::task_group group;
16
18 template<typename F>
19 void execute( F&& f )
20 {
21 arena.execute( [this, f]()
22 {
23 group.run( [f]
24 {
25 f();
26 } );
27 } );
28 }
29
32 void wait()
33 {
34 arena.execute( [this]
35 {
36 group.wait();
37 } );
38 }
39};
40
41} //namespace MR
Definition MRTbbTaskArenaAndGroup.h:13
tbb::task_group group
Definition MRTbbTaskArenaAndGroup.h:15
tbb::task_arena arena
Definition MRTbbTaskArenaAndGroup.h:14
void execute(F &&f)
runs given function within this task group and task arena
Definition MRTbbTaskArenaAndGroup.h:19
void wait()
Definition MRTbbTaskArenaAndGroup.h:32