SkTRacy<T> -> SkAtomic<T>
authormtklein <mtklein@chromium.org>
Tue, 24 Feb 2015 22:38:12 +0000 (14:38 -0800)
committerCommit bot <commit-bot@chromium.org>
Tue, 24 Feb 2015 22:38:12 +0000 (14:38 -0800)
commit86821b56704ebc0a1a6d1e5d1e329369ac797c98
tree4162e8b041740ad1e7a535105f1440637110655e
parent7eeba2587760a0802fd2b90765b4fd0e5e895375
SkTRacy<T> -> SkAtomic<T>

Like SkTRacy<T>, TSAN will not complain about these.  Unlike SkTRacy<T>, TSAN
should not complain about these: SkAtomic<T> are threadsafe.

This should fix the races now suppressed in TSAN.  As written, the memory
barriers we're using in SkPixelRef will be dumb but safe (really, dumbest
possible but safest possible).  If we see a perf hit, we can follow up by
putting Ben and I in a room for a while, thinking about it really hard, and
using the minimum-strength safe memory barriers.

A refactor that steals a bit from the genID would also still be possible with
this approach.

BUG=chromium:437511

CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN-Trybot

Review URL: https://codereview.chromium.org/955803002
include/core/SkAtomics.h
include/core/SkDynamicAnnotations.h
include/core/SkPixelRef.h
src/core/SkPixelRef.cpp