Skip to content

Commit

Permalink
freertos: Add os_cond_broadcast for pthread wrapper (bytecodealliance…
Browse files Browse the repository at this point in the history
  • Loading branch information
tkernelcn committed Dec 28, 2023
1 parent f2e0034 commit 6ad47d6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/shared/platform/common/freertos/freertos_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,3 +452,20 @@ os_cond_signal(korp_cond *cond)

return BHT_OK;
}

int
os_cond_broadcast(korp_cond *cond)
{
/* Signal all of the wait node of wait list */
xSemaphoreTake(cond->wait_list_lock, portMAX_DELAY);
if (cond->thread_wait_list) {
os_thread_wait_node *p = cond->thread_wait_list;
while (p) {
xSemaphoreGive(p->sem);
p = p->next;
}
}
xSemaphoreGive(cond->wait_list_lock);

return BHT_OK;
}

0 comments on commit 6ad47d6

Please sign in to comment.