#include <SkOnce.h>
|
constexpr | SkOnce ()=default |
|
template<typename Fn , typename... Args> |
void | operator() (Fn &&fn, Args &&... args) |
|
Definition at line 22 of file SkOnce.h.
◆ SkOnce()
constexpr SkOnce::SkOnce |
( |
| ) |
|
|
constexprdefault |
◆ operator()()
template<typename Fn , typename... Args>
void SkOnce::operator() |
( |
Fn && |
fn, |
|
|
Args &&... |
args |
|
) |
| |
|
inline |
Definition at line 27 of file SkOnce.h.
27 {
28 auto state = fState.load(std::memory_order_acquire);
29
31 return;
32 }
33
34
35 if (
state == NotStarted && fState.compare_exchange_strong(
state, Claimed,
36 std::memory_order_relaxed,
37 std::memory_order_relaxed)) {
38
39 fn(std::forward<Args>(
args)...);
40 return fState.store(Done, std::memory_order_release);
41 }
42
43
44
46 while (fState.load(std::memory_order_acquire) != Done) { }
48 }
#define SK_POTENTIALLY_BLOCKING_REGION_END
#define SK_POTENTIALLY_BLOCKING_REGION_BEGIN
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
The documentation for this class was generated from the following file:
- third_party/skia/include/private/base/SkOnce.h