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

Issue 123093002: Use a spinlock in SkOnce. (Closed)

Created:
6 years, 11 months ago by mtklein
Modified:
6 years, 11 months ago
Reviewers:
bungeman-skia, reed1
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Use a spinlock in SkOnce. SkOnceFlag is now statically initializable on all platforms. Also adds sk_atomic_cas, used to implement new SkSpinlock. Going to punt on making SkOnceFlag any smaller (for now, it's 8 bytes). We could conceivably get it down to two bits, one for done and one for a one-bit spinlock (we'd need atomic-& and atomic-| to make that work, but they appear to be available everywhere). BUG=skia:1929 Committed: http://code.google.com/p/skia/source/detail?r=12968

Patch Set 1 #

Total comments: 2

Patch Set 2 : check we're initialized in debug mode #

Total comments: 7

Patch Set 3 : bungeman #

Patch Set 4 : explicitly initialize #

Total comments: 2

Patch Set 5 : comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+64 lines, -12 lines) Patch
M include/core/SkThread.h View 1 2 3 4 2 chunks +34 lines, -0 lines 0 comments Download
M src/core/SkOnce.h View 1 2 3 4 chunks +7 lines, -12 lines 0 comments Download
M src/ports/SkAtomics_android.h View 1 2 1 chunk +7 lines, -0 lines 0 comments Download
M src/ports/SkAtomics_none.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/ports/SkAtomics_sync.h View 1 chunk +6 lines, -0 lines 0 comments Download
M src/ports/SkAtomics_win.h View 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
mtklein
6 years, 11 months ago (2014-01-01 21:40:36 UTC) #1
reed1
api LGTM, deferring to bungeman https://codereview.chromium.org/123093002/diff/1/include/core/SkThread.h File include/core/SkThread.h (right): https://codereview.chromium.org/123093002/diff/1/include/core/SkThread.h#newcode53 include/core/SkThread.h:53: // This is POD ...
6 years, 11 months ago (2014-01-02 13:53:33 UTC) #2
mtklein
https://codereview.chromium.org/123093002/diff/1/include/core/SkThread.h File include/core/SkThread.h (right): https://codereview.chromium.org/123093002/diff/1/include/core/SkThread.h#newcode53 include/core/SkThread.h:53: // This is POD and must be zero-initialized. On ...
6 years, 11 months ago (2014-01-02 16:28:16 UTC) #3
bungeman-skia
Other than the comments below on the implementation, I'm concerned about the use of pure ...
6 years, 11 months ago (2014-01-07 22:05:41 UTC) #4
mtklein
I'd like to submit this now with the understanding we will continue to evolve how ...
6 years, 11 months ago (2014-01-08 17:02:17 UTC) #5
mtklein
On 2014/01/08 17:02:17, mtklein wrote: > I'd like to submit this now with the understanding ...
6 years, 11 months ago (2014-01-08 17:14:24 UTC) #6
bungeman-skia
With the documentation comments I'll give this a lgtm (for now). I'm still rather grumpy ...
6 years, 11 months ago (2014-01-08 18:35:43 UTC) #7
mtklein
On 2014/01/08 18:35:43, bungeman1 wrote: > With the documentation comments I'll give this a lgtm ...
6 years, 11 months ago (2014-01-08 18:48:19 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/mtklein@google.com/123093002/270001
6 years, 11 months ago (2014-01-08 18:48:39 UTC) #9
commit-bot: I haz the power
6 years, 11 months ago (2014-01-08 21:16:00 UTC) #10
Message was sent while issue was closed.
Change committed as 12968

Powered by Google App Engine
This is Rietveld 408576698