#include <SkTaskGroup.h>
Definition at line 20 of file SkTaskGroup.h.
◆ SkTaskGroup()
Definition at line 14 of file SkTaskGroup.cpp.
14: fPending(0), fExecutor(executor) {}
◆ ~SkTaskGroup()
SkTaskGroup::~SkTaskGroup |
( |
| ) |
|
|
inline |
◆ add()
Definition at line 16 of file SkTaskGroup.cpp.
16 {
17 fPending.fetch_add(+1, std::memory_order_relaxed);
18 fExecutor.
add([
this, fn{std::move(fn)}] {
19 fn();
20 fPending.fetch_add(-1, std::memory_order_release);
21 });
22}
virtual void add(std::function< void(void)>)=0
◆ batch()
Definition at line 24 of file SkTaskGroup.cpp.
24 {
25
26 fPending.fetch_add(+
N, std::memory_order_relaxed);
27 for (
int i = 0;
i <
N;
i++) {
28 fExecutor.
add([fn,
i,
this] {
30 fPending.fetch_add(-1, std::memory_order_release);
31 });
32 }
33}
◆ done()
bool SkTaskGroup::done |
( |
| ) |
const |
Definition at line 35 of file SkTaskGroup.cpp.
35 {
36 return fPending.load(std::memory_order_acquire) == 0;
37}
◆ wait()
void SkTaskGroup::wait |
( |
| ) |
|
The documentation for this class was generated from the following files: