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

Issue 14387002: Adding TryPostTask to the message loop (Closed)

Created:
7 years, 8 months ago by cpu_(ooo_6.6-7.5)
Modified:
7 years, 7 months ago
CC:
chromium-reviews, erikwright+watch_chromium.org, sadrul, miu
Visibility:
Public.

Description

Adding TryPostTask to the message loop This is to allow code in certain high priority threads to use the task/message loop facility. For example the audio threads that currently use sentinel booleans and recurring timers. TryPostTask will fail if it is going contend for the lock. The caller must handle that case. Note that the current tests do not test the contended mode. I don't see a way to test that case without introducing runtime penalty for all of chrome. BUG=none TEST=included Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=197315

Patch Set 1 #

Patch Set 2 : fix bool #

Total comments: 6

Patch Set 3 : adding assert #

Patch Set 4 : changes per jar comments #

Total comments: 2

Patch Set 5 : change comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+95 lines, -18 lines) Patch
M base/message_loop.h View 1 2 3 4 4 chunks +24 lines, -7 lines 0 comments Download
M base/message_loop.cc View 1 2 3 7 chunks +28 lines, -9 lines 0 comments Download
M base/message_loop_unittest.cc View 1 2 3 3 chunks +37 lines, -2 lines 0 comments Download
M base/synchronization/lock.h View 1 2 3 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
cpu_(ooo_6.6-7.5)
as per our conversation.
7 years, 8 months ago (2013-04-20 18:39:50 UTC) #1
jar (doing other things)
Personal preference is that I'd rather keep as much locking logic in the AutoLock class ...
7 years, 8 months ago (2013-04-21 15:29:34 UTC) #2
cpu_(ooo_6.6-7.5)
https://codereview.chromium.org/14387002/diff/4001/base/message_loop.cc File base/message_loop.cc (right): https://codereview.chromium.org/14387002/diff/4001/base/message_loop.cc#newcode613 base/message_loop.cc:613: AutoLock locked(incoming_queue_lock_, AutoLock::NoAcquire()); On 2013/04/21 15:29:35, jar wrote: > ...
7 years, 8 months ago (2013-04-22 23:30:59 UTC) #3
cpu_(ooo_6.6-7.5)
forgot about the lock_.AssertAcquired(); sounds good. I'll add it.
7 years, 8 months ago (2013-04-23 17:47:34 UTC) #4
cpu_(ooo_6.6-7.5)
assert added PTAL.
7 years, 8 months ago (2013-04-24 16:48:59 UTC) #5
miu
lgtm Thanks for doing this, cpu! :) It'll feel great to rip out the extra ...
7 years, 8 months ago (2013-04-26 07:27:00 UTC) #6
cpu_(ooo_6.6-7.5)
jar, ping
7 years, 8 months ago (2013-04-26 20:02:15 UTC) #7
jar (doing other things)
I still think this would be better done in the auto_lock class using state there ...
7 years, 8 months ago (2013-04-26 21:59:43 UTC) #8
jar (doing other things)
I still think it is an ugly approach, but at least it is not that ...
7 years, 7 months ago (2013-04-29 17:27:18 UTC) #9
cpu_(ooo_6.6-7.5)
I agree, it it does not get used by the m29 I'll remove it. https://codereview.chromium.org/14387002/diff/18001/base/message_loop.h ...
7 years, 7 months ago (2013-04-30 05:26:04 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cpu@chromium.org/14387002/23001
7 years, 7 months ago (2013-04-30 05:26:29 UTC) #11
commit-bot: I haz the power
7 years, 7 months ago (2013-04-30 08:54:18 UTC) #12
Message was sent while issue was closed.
Change committed as 197315

Powered by Google App Engine
This is Rietveld 408576698