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

Issue 1734383002: Modernize SkSpinlock. (Closed)

Created:
4 years, 10 months ago by mtklein_C
Modified:
4 years, 9 months ago
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Modernize SkSpinlock. - Use std::atomic directly. - No more need for SkPODSpinlock or SK_DECLARE_STATIC_SPINLOCK. Now simple code like this works as you'd hope: static SkSpinlock gLock; That is, it starts unlocked and there's no static initializer. std::atomic_flag would make this terser and standard-guaranteed, but ATOMIC_FLAG_INIT caused not-yet-implemented errors on MSVC 2013. The generated code for this approach is identical. It appears the implicit constructor is constexpr when all the member initializers are. I'm hoping this way of producing constexpr constructors without typing "constexpr" gives us a way to eliminate more SkFoo / SkBaseFoo distinctions and SK_DECLARE_STATIC_FOO. This was certainly the easiest. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1734383002 Committed: https://skia.googlesource.com/skia/+/15923c9e475894d89028b7a6a0b38aeeb9f9e645

Patch Set 1 #

Patch Set 2 : std::atomic_flag #

Patch Set 3 : an #

Patch Set 4 : std::atomic<bool> #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -28 lines) Patch
M dm/DM.cpp View 5 chunks +5 lines, -5 lines 0 comments Download
M include/private/SkOnce.h View 1 chunk +1 line, -1 line 0 comments Download
M include/private/SkSpinlock.h View 1 2 3 1 chunk +7 lines, -17 lines 0 comments Download
M src/core/SkSpinlock.cpp View 2 3 1 chunk +5 lines, -3 lines 0 comments Download
M src/gpu/GrProcessor.cpp View 1 chunk +1 line, -1 line 0 comments Download
M src/gpu/batches/GrBatch.cpp View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 28 (19 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1734383002/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1734383002/40001
4 years, 10 months ago (2016-02-26 14:35:13 UTC) #4
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86_64-Debug-Trybot/builds/6638)
4 years, 10 months ago (2016-02-26 14:38:50 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1734383002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1734383002/60001
4 years, 10 months ago (2016-02-26 14:43:26 UTC) #10
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 10 months ago (2016-02-26 14:56:58 UTC) #17
mtklein_C
4 years, 10 months ago (2016-02-26 14:58:11 UTC) #20
mtklein_C
+Herb
4 years, 9 months ago (2016-02-29 16:52:42 UTC) #23
herb_g
lgtm
4 years, 9 months ago (2016-02-29 17:52:23 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1734383002/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1734383002/60001
4 years, 9 months ago (2016-02-29 17:59:27 UTC) #26
commit-bot: I haz the power
4 years, 9 months ago (2016-02-29 18:14:41 UTC) #28
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://skia.googlesource.com/skia/+/15923c9e475894d89028b7a6a0b38aeeb9f9e645

Powered by Google App Engine
This is Rietveld 408576698