diff --git a/epicardium/user_core/lifecycle.c b/epicardium/user_core/lifecycle.c index 89d4dce4973ed9df3a11a0ba89dcad7d9878dcb8..5f3caddfdcae71851f47b0d014f295b2d23b6832 100644 --- a/epicardium/user_core/lifecycle.c +++ b/epicardium/user_core/lifecycle.c @@ -109,6 +109,9 @@ static int do_load(struct load_info *info) return -EPERM; } + /* Signal the dispatcher to return early from applicable API calls. */ + xTaskNotifyGive(dispatcher_task_id); + mutex_lock(&api_mutex); if (info->do_reset) { @@ -126,9 +129,17 @@ static int do_load(struct load_info *info) * call. */ while (!core1_is_ready()) { + /* + * Wake up the dispatcher task prematurely. This is needed so + * the second xTaskNotifyGive() below can then break out the + * dispatcher from e.g. an epic_sleep() call. + */ + xTaskNotifyGive(dispatcher_task_id); mutex_unlock(&api_mutex); /* Sleep so the dispatcher task can take the lock. */ vTaskDelay(8); + /* Signal the dispatcher to return early from applicable API calls. */ + xTaskNotifyGive(dispatcher_task_id); mutex_lock(&api_mutex); }