diff options
author | Shawn Nematbakhsh <shawnn@chromium.org> | 2015-11-25 16:00:21 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2015-11-30 12:27:58 -0800 |
commit | 6e4848c2000bf41352e02935d2f9bdd482494fb0 (patch) | |
tree | 873c1e4eb9848e644cb8c5aa12cfafe7ad7556ca /core/host | |
parent | 0c4408efdcd37a20c57e74b4b0778e5a477926ac (diff) | |
download | chrome-ec-6e4848c2000bf41352e02935d2f9bdd482494fb0.tar.gz |
task: Don't discard events on mutex contention
On mutex contention, call task_wait_event_mask(), which will wait for
a mutex event without clearing other pending events.
BUG=chrome-os-partner:47918,chromium:435611,chromium:435612
BRANCH=None
TEST=Manual on snoball. Verify samus can successfully negotiate PD power
contract when attached to snoball.
Signed-off-by: Shawn Nematbakhsh <shawnn@chromium.org>
Change-Id: I85cd32f2670246da9e4787025390aba2c93f9c36
Reviewed-on: https://chromium-review.googlesource.com/314492
Commit-Ready: Shawn N <shawnn@chromium.org>
Tested-by: Shawn N <shawnn@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Diffstat (limited to 'core/host')
-rw-r--r-- | core/host/task.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/core/host/task.c b/core/host/task.c index 9c2e650c84..8e85679890 100644 --- a/core/host/task.c +++ b/core/host/task.c @@ -246,10 +246,7 @@ void mutex_lock(struct mutex *mtx) } if (!value) - /* Contention on the mutex */ - /* TODO(crbug.com/435612, crbug.com/435611) - * This discards any pending events! */ - task_wait_event(-1); + task_wait_event_mask(TASK_EVENT_MUTEX, 0); } while (!value); mtx->waiters &= ~id; |