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

Issue 1904483003: SkOnce: 2 bytes -> 1 byte (Closed)

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

Description

SkOnce: 2 bytes -> 1 byte This uses the same logic we worked out for SkOncePtr to reduce the memory footprint of SkOnce from a done byte and lock byte to a single 3-state byte: - NotStarted: no thread has tried to run fn() yet - Active: a thread is running fn() - Done: fn() is complete Threads which see Done return immediately. Threads which see NotStarted try to move to Active, run fn(), then move to Done. Threads which see Active spin until the active thread moves to Done. This additionally fixes a too-weak memory order bug in SkOncePtr, and adds a big note to explain. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1904483003 Committed: https://skia.googlesource.com/skia/+/df02d338be8e3c1c50b48a3a9faa582703a39c07 Committed: https://skia.googlesource.com/skia/+/650f9e9a2630026d578970c6d031d7d4644f63b4

Patch Set 1 #

Patch Set 2 : memory order bug fix #

Patch Set 3 : note #

Total comments: 4

Patch Set 4 : Done Check, Calling #

Patch Set 5 : basic uint8_t type #

Unified diffs Side-by-side diffs Delta from patch set Stats (+41 lines, -10 lines) Patch
M include/private/SkOnce.h View 1 2 3 4 2 chunks +39 lines, -9 lines 0 comments Download
M include/private/SkOncePtr.h View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 31 (15 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/1904483003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904483003/1
4 years, 8 months ago (2016-04-19 19:40:08 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-19 19:53:38 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/1904483003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904483003/20001
4 years, 8 months ago (2016-04-19 19:58:18 UTC) #9
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904483003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904483003/40001
4 years, 8 months ago (2016-04-19 19:59:58 UTC) #12
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 8 months ago (2016-04-19 20:14:33 UTC) #14
mtklein_C
4 years, 8 months ago (2016-04-19 20:32:46 UTC) #16
herb_g
https://codereview.chromium.org/1904483003/diff/40001/include/private/SkOnce.h File include/private/SkOnce.h (right): https://codereview.chromium.org/1904483003/diff/40001/include/private/SkOnce.h#newcode26 include/private/SkOnce.h:26: if (state == NotStarted) { Instead of having: if ...
4 years, 8 months ago (2016-04-20 16:38:37 UTC) #17
mtklein_C
https://codereview.chromium.org/1904483003/diff/40001/include/private/SkOnce.h File include/private/SkOnce.h (right): https://codereview.chromium.org/1904483003/diff/40001/include/private/SkOnce.h#newcode26 include/private/SkOnce.h:26: if (state == NotStarted) { On 2016/04/20 at 16:38:37, ...
4 years, 8 months ago (2016-04-20 17:44:37 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904483003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904483003/60001
4 years, 8 months ago (2016-04-20 17:44:42 UTC) #20
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
4 years, 8 months ago (2016-04-20 17:44:43 UTC) #21
herb_g
lgtm
4 years, 8 months ago (2016-04-20 17:52:05 UTC) #22
commit-bot: I haz the power
Committed patchset #4 (id:60001) as https://skia.googlesource.com/skia/+/df02d338be8e3c1c50b48a3a9faa582703a39c07
4 years, 8 months ago (2016-04-20 17:54:57 UTC) #24
fmalita_google_do_not_use
On 2016/04/20 17:54:57, commit-bot: I haz the power wrote: > Committed patchset #4 (id:60001) as ...
4 years, 8 months ago (2016-04-20 19:47:32 UTC) #25
mtklein_C
A revert of this CL (patchset #4 id:60001) has been created in https://codereview.chromium.org/1898413004/ by mtklein@chromium.org. ...
4 years, 8 months ago (2016-04-20 20:02:01 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904483003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904483003/80001
4 years, 8 months ago (2016-04-20 20:39:20 UTC) #29
commit-bot: I haz the power
4 years, 8 months ago (2016-04-20 20:49:19 UTC) #31
Message was sent while issue was closed.
Committed patchset #5 (id:80001) as
https://skia.googlesource.com/skia/+/650f9e9a2630026d578970c6d031d7d4644f63b4

Powered by Google App Engine
This is Rietveld 408576698