commit | 59c9203321cf4afb48597f39e4bdd4ae91da12a0 | [log] [tgz] |
---|---|---|
author | mtklein <mtklein@chromium.org> | Wed Feb 25 12:51:55 2015 -0800 |
committer | Commit bot <commit-bot@chromium.org> | Wed Feb 25 12:51:55 2015 -0800 |
tree | 1c446194af3cdc6d2b68c6e137c17450c72b52db | |
parent | edeb7a97aded2107fd6a25562e1bb7fdcb96c958 [diff] |
Fix the race to set the new gen ID. There's a small window where two threads can both see the gen ID is zero, both go get new distinct genIDs, but race to write them. This now uses compare_exchange to read and leave the winner's ID in place when there's a race. SkAtomics isn't public. TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/956013002