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

Unified Diff: include/core/SkRefCnt.h

Issue 687293002: Issue acquire barrier in SkRefCnt::unique(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkRefCnt.h
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index 459ad251a8be0b89330c16dd6e43a1fdcf3d6790..4da2fbbc936266662a4510b64a8ce3a9de921972 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -51,11 +51,11 @@ public:
bool unique() const {
// We believe we're reading fRefCnt in a safe way here, so we stifle the TSAN warning about
// an unproctected read. Generally, don't read fRefCnt, and don't stifle this warning.
- bool const unique = (1 == SK_ANNOTATE_UNPROTECTED_READ(fRefCnt));
+ bool const unique = (1 == sk_acquire_load(&fRefCnt));
if (unique) {
// Acquire barrier (L/SL), if not provided by load of fRefCnt.
// Prevents user's 'unique' code from happening before decrements.
- //TODO: issue the barrier.
+ //TODO: issue the barrier only when unique is true
}
return unique;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698