Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(381)

Unified Diff: include/core/SkOnce.h

Issue 247813005: teach TSAN about SkSpinlock, SkRefCnt, and SkOnce (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: undo Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkDynamicAnnotations.h ('k') | include/core/SkRefCnt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkOnce.h
diff --git a/include/core/SkOnce.h b/include/core/SkOnce.h
index a42e7022f5a2058c99e7d2e60abc9e6f82cd9c10..d5330b94087a1d52e2ce8336747e0642075f8523 100644
--- a/include/core/SkOnce.h
+++ b/include/core/SkOnce.h
@@ -54,12 +54,10 @@ struct SkSpinlock {
while (!sk_atomic_cas(&thisIsPrivate, 0, 1)) {
// spin
}
- SK_ANNOTATE_RWLOCK_ACQUIRED(this, true);
}
void release() {
SkASSERT(shouldBeZero == 0);
- SK_ANNOTATE_RWLOCK_RELEASED(this, true);
// This requires a release memory barrier before storing, which sk_atomic_cas guarantees.
SkAssertResult(sk_atomic_cas(&thisIsPrivate, 1, 0));
}
@@ -147,7 +145,6 @@ static void sk_once_slow(bool* done, Lock* lock, Func f, Arg arg, void (*atExit)
// observable whenever we observe *done == true.
release_barrier();
*done = true;
- SK_ANNOTATE_HAPPENS_BEFORE(done);
}
}
@@ -168,7 +165,6 @@ inline void SkOnce(bool* done, Lock* lock, Func f, Arg arg, void(*atExit)()) {
// happens after f(arg), so by syncing to once->done = true here we're
// forcing ourselves to also wait until the effects of f(arg) are readble.
acquire_barrier();
- SK_ANNOTATE_HAPPENS_AFTER(done);
}
template <typename Func, typename Arg>
« no previous file with comments | « include/core/SkDynamicAnnotations.h ('k') | include/core/SkRefCnt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698