Lines Matching defs:Work
58 if (!gGlobal) { // If we have no threads, the work must already be done.
65 Work work;
67 // We're stealing work opportunistically,
68 // so we never call fWorkAvailable.wait(), which could sleep us if there's no work.
72 // Someone has picked up all the work (including ours). How nice of them!
76 work = gGlobal->fWork.back();
79 // This Work isn't necessarily part of our SkTaskGroup of interest, but that's fine.
81 work.fn();
82 work.pending->fetch_add(-1, sk_memory_order_release); // Pairs with load above.
94 struct Work {
126 Work work = { fn, pending };
130 fWork.push_back(work);
140 Work work = { [i, fn]() { fn(i); }, pending };
141 fWork.push_back(work);
149 Work work;
151 // Sleep until there's work available, and claim one unit of Work as we wake.
156 // Someone in Wait() stole our work (fWorkAvailable is an upper bound).
160 work = pool->fWork.back();
163 if (!work.fn) {
166 work.fn();
167 work.pending->fetch_add(-1, sk_memory_order_release); // Pairs with load in Wait().
173 SkTArray<Work> fWork;
180 // So fWorkAvailable may overcount actual the work available.