Lines Matching refs:pending
42 static void Add(std::function<void(void)> fn, SkAtomic<int32_t>* pending) { in Add() argument
46 gGlobal->add(fn, pending); in Add()
49 static void Batch(int N, std::function<void(int)> fn, SkAtomic<int32_t>* pending) { in Batch() argument
54 gGlobal->batch(N, fn, pending); in Batch()
57 static void Wait(SkAtomic<int32_t>* pending) { in Wait() argument
59 SkASSERT(pending->load(sk_memory_order_relaxed) == 0); in Wait()
63 while (pending->load(sk_memory_order_acquire) > 0) { in Wait()
82 work.pending->fetch_add(-1, sk_memory_order_release); // Pairs with load above. in Wait()
96 SkAtomic<int32_t>* pending; // then decrement pending afterwards. member
125 void add(std::function<void(void)> fn, SkAtomic<int32_t>* pending) { in add() argument
126 Work work = { fn, pending }; in add()
127 pending->fetch_add(+1, sk_memory_order_relaxed); // No barrier needed. in add()
135 void batch(int N, std::function<void(int)> fn, SkAtomic<int32_t>* pending) { in batch() argument
136 pending->fetch_add(+N, sk_memory_order_relaxed); // No barrier needed. in batch()
140 Work work = { [i, fn]() { fn(i); }, pending }; in batch()
167 work.pending->fetch_add(-1, sk_memory_order_release); // Pairs with load in Wait(). in Loop()