17 fPending.fetch_add(+1, std::memory_order_relaxed);
18 fExecutor.
add([
this, fn{std::move(fn)}] {
20 fPending.fetch_add(-1, std::memory_order_release);
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);
36 return fPending.load(std::memory_order_acquire) == 0;
44 while (!this->
done()) {
virtual void add(std::function< void(void)>)=0
static void SetDefault(SkExecutor *)
static std::unique_ptr< SkExecutor > MakeLIFOThreadPool(int threads=0, bool allowBorrowing=true)
SkTaskGroup(SkExecutor &executor=SkExecutor::GetDefault())
void batch(int N, std::function< void(int)> fn)
void add(std::function< void(void)> fn)
Dart_NativeFunction function
std::unique_ptr< SkExecutor > fThreadPool