Home | History | Annotate | Download | only in core

Lines Matching full:lock

43 // If you've already got a lock and a flag to use, this variant lets you avoid an extra SkOnceFlag.
44 template <typename Lock>
45 inline void SkOnce(bool* done, Lock* lock, void (*f)());
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) {
74 lock->acquire();
88 lock->release();
92 template <typename Lock, typename Arg>
93 inline void SkOnce(bool* done, Lock* lock, void (*f)(Arg), Arg arg) {
108 // If we get the lock, great, we call f(arg), release true into done, and drop the lock.
109 // If we race and don't get the lock first, we'll wait for the first guy to finish.
110 // Then lock acquire() will give us at least an acquire memory barrier to get the same
112 // then just drop the lock and return.
114 sk_once_slow(done, lock, f, arg);
134 template <typename Lock>
135 inline void SkOnce(bool* done, Lock* lock, void (*func)()) {
136 return SkOnce(done, lock, sk_once_no_arg_adaptor, func);