diff options
author | bungeman <bungeman@google.com> | 2014-10-29 12:31:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-29 12:31:33 -0700 |
commit | a5cf665997d73169e2f5260eaf9643af1f309762 (patch) | |
tree | e302aabd647222a30a991c1c0054d2cfdbccfa33 /include | |
parent | 329bf4862e9d5e05363c2b071d8ca475a0ef1952 (diff) |
Issue acquire barrier in SkRefCnt::unique().
When unique() returns true, it must also issue an acquire barrier.
Note that this change may adversly impact SkPath performance,
but editing SkPaths is already a performance issue.
BUG=chromium:258499
No API changes.
TBR=reed@google.com
Review URL: https://codereview.chromium.org/687293002
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkRefCnt.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h index 459ad251a8..4da2fbbc93 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; } |