Lines Matching refs:done
46 inline void SkOnce(bool* done, Lock* lock, void (*f)());
49 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg);
86 static void sk_once_slow(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
88 if (!*done) {
91 // done before here---in particular, those done by calling f(arg)---are observable
92 // before the writes after the line, *done = true.
95 // to and including f(arg), then check in *done=true as a subsequent change".
98 // observable whenever we observe *done == true.
99 sk_release_store(done, true);
106 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
107 if (!SK_ANNOTATE_UNPROTECTED_READ(*done)) {
108 sk_once_slow(done, lock, f, arg);
112 // calling f(arg)---is at least as current as the value we read from done.
115 // commit where we wrote done = true".
117 // The release barrier in sk_once_slow guaranteed that done = true
118 // happens after f(arg), so by syncing to done = true here we're
120 SkAssertResult(sk_acquire_load(done));
140 inline void SkOnce(bool* done, Lock* lock, void (*func)()) {
141 return SkOnce(done, lock, sk_once_no_arg_adaptor, func);