diff options
author | Dawid Niedzwiecki <dn@semihalf.com> | 2020-11-06 09:20:56 +0100 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-14 19:59:09 +0000 |
commit | f96f176c303a73973d7cf5ddf1abf86f534a6e39 (patch) | |
tree | a793c58f008cfa94cc93ea34627fd1b6457e3a1b /cts | |
parent | a23ef3d074335f2b6953194671f966117fd1fe60 (diff) | |
download | chrome-ec-f96f176c303a73973d7cf5ddf1abf86f534a6e39.tar.gz |
task_set_event: remove the wait argument
There is an option in the task_set_event function which force
the calling task to wait for an event. However, the option is never
used thus remove it.
This also will help in the Zephyr migration process.
BUG=b:172360521
BRANCH=none
TEST=make buildall
Signed-off-by: Dawid Niedzwiecki <dn@semihalf.com>
Change-Id: Ic152fd3d6862d487bcc0024c48d136556c0b81bc
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2521599
Reviewed-by: Jett Rink <jettrink@chromium.org>
Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Commit-Queue: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'cts')
-rw-r--r-- | cts/mutex/dut.c | 3 | ||||
-rw-r--r-- | cts/mutex/th.c | 3 | ||||
-rw-r--r-- | cts/task/dut.c | 11 |
3 files changed, 11 insertions, 6 deletions
diff --git a/cts/mutex/dut.c b/cts/mutex/dut.c index 4fcea73fdf..9cbbd8badb 100644 --- a/cts/mutex/dut.c +++ b/cts/mutex/dut.c @@ -82,7 +82,8 @@ static enum cts_rc lock_unlock_test(void) /* --- Serialization to test simple contention --- */ ccprintf("Simple contention :\n"); /* lock the mutex from the other task */ - task_set_event(TASK_ID_MTX2, TASK_EVENT_WAKE, 1); + task_set_event(TASK_ID_MTX2, TASK_EVENT_WAKE); + task_wait_event(0); /* block on the mutex */ ccprintf("MTX1: blocking...\n"); mutex_lock(&mtx); diff --git a/cts/mutex/th.c b/cts/mutex/th.c index 4fcea73fdf..9cbbd8badb 100644 --- a/cts/mutex/th.c +++ b/cts/mutex/th.c @@ -82,7 +82,8 @@ static enum cts_rc lock_unlock_test(void) /* --- Serialization to test simple contention --- */ ccprintf("Simple contention :\n"); /* lock the mutex from the other task */ - task_set_event(TASK_ID_MTX2, TASK_EVENT_WAKE, 1); + task_set_event(TASK_ID_MTX2, TASK_EVENT_WAKE); + task_wait_event(0); /* block on the mutex */ ccprintf("MTX1: blocking...\n"); mutex_lock(&mtx); diff --git a/cts/task/dut.c b/cts/task/dut.c index 7297b7de96..feb25f3f2c 100644 --- a/cts/task/dut.c +++ b/cts/task/dut.c @@ -34,10 +34,13 @@ void task_abc(void *data) while (1) { wake_count[id]++; - if (id == 2 && wake_count[id] == repeat_count) - task_set_event(TASK_ID_CTS, TASK_EVENT_WAKE, 1); - else - task_set_event(next, TASK_EVENT_WAKE, 1); + if (id == 2 && wake_count[id] == repeat_count) { + task_set_event(TASK_ID_CTS, TASK_EVENT_WAKE); + task_wait_event(-1); + } else { + task_set_event(next, TASK_EVENT_WAKE); + task_wait_event(-1); + } } } |