mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-05-14 05:31:13 +00:00
freertos: Add os_cond_broadcast for pthread wrapper (#2937)
This commit is contained in:
parent
22c5c90340
commit
92bf8547aa
|
@ -452,3 +452,20 @@ os_cond_signal(korp_cond *cond)
|
||||||
|
|
||||||
return BHT_OK;
|
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;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user