Lines Matching refs:Arg
40 template <typename Arg>
41 inline void SkOnce(SkOnceFlag* once, void (*f)(Arg), Arg arg);
47 template <typename Lock, typename Arg>
48 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg);
72 template <typename Lock, typename Arg>
73 static void sk_once_slow(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
76 f(arg);
78 // done before here---in particular, those done by calling f(arg)---are observable
82 // to and including f(arg), then check in *done=true as a subsequent change".
84 // We'll use this in the fast path to make sure f(arg)'s effects are
92 template <typename Lock, typename Arg>
93 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
97 // calling f(arg)---is at least as current as the value we read from done.
103 // happens after f(arg), so by syncing to done = true here we're
104 // forcing ourselves to also wait until the effects of f(arg) are readble.
107 // We'll try to call f(arg) in sk_once_slow.
108 // If we get the lock, great, we call f(arg), release true into done, and drop the lock.
114 sk_once_slow(done, lock, f, arg);
118 template <typename Arg>
119 inline void SkOnce(SkOnceFlag* once, void (*f)(Arg), Arg arg) {
120 return SkOnce(once->mutableDone(), once, f, arg);
125 // (We pass _this_ as the function and the no-arg function as its argument. Cute eh?)