diff --git a/core/cortex-m0/task.c b/core/cortex-m0/task.c index 7179d05629..1d4ded513e 100644 --- a/core/cortex-m0/task.c +++ b/core/cortex-m0/task.c @@ -509,9 +509,8 @@ void mutex_lock(struct mutex *mtx) if (mtx->lock == 0) break; __asm__ __volatile__("cpsie i"); - /* TODO(crbug.com/435612, crbug.com/435611) - * This discards any pending events! */ - task_wait_event(0); /* Contention on the mutex */ + /* Contention on the mutex */ + task_wait_event_mask(TASK_EVENT_MUTEX, 0); } mtx->lock = 2; __asm__ __volatile__("cpsie i"); 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;