tweak SkOnce.h header to work around issues with std::atomic::compare_exchange_strong
BUG=skia: Change-Id: Id29c47cb4bec6a6d70d6514d18fa4ab9bd31b1e2 Reviewed-on: https://skia-review.googlesource.com/6200 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
This commit is contained in:
parent
fc8dc3194a
commit
ee1c73fc1b
@ -31,6 +31,7 @@ public:
|
||||
|
||||
// If it looks like no one has started calling fn(), try to claim that job.
|
||||
if (state == NotStarted && fState.compare_exchange_strong(state, Claimed,
|
||||
std::memory_order_relaxed,
|
||||
std::memory_order_relaxed)) {
|
||||
// Great! We'll run fn() then notify the other threads by releasing Done into fState.
|
||||
fn(std::forward<Args>(args)...);
|
||||
|
Loading…
Reference in New Issue
Block a user