Lines Matching refs:done
45 inline void SkOnce(bool* done, Lock* lock, void (*f)());
48 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg);
73 static void sk_once_slow(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
75 if (!sk_atomic_load(done, sk_memory_order_relaxed)) {
78 // done before here---in particular, those done by calling f(arg)---are observable
79 // before the writes after the line, *done = true.
82 // to and including f(arg), then check in *done=true as a subsequent change".
85 // observable whenever we observe *done == true.
86 sk_release_store(done, true);
93 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
94 // When *done == true:
97 // calling f(arg)---is at least as current as the value we read from done.
100 // commit where we wrote done = true".
102 // The release barrier in sk_once_slow guaranteed that done = true
103 // happens after f(arg), so by syncing to done = true here we're
106 // When *done == false:
108 // If we get the lock, great, we call f(arg), release true into done, and drop the lock.
111 // effect as the acquire load in the *done == true fast case. We'll see *done is true,
113 if (!sk_atomic_load(done, sk_memory_order_acquire)) {
114 sk_once_slow(done, lock, f, arg);
135 inline void SkOnce(bool* done, Lock* lock, void (*func)()) {
136 return SkOnce(done, lock, sk_once_no_arg_adaptor, func);