Skip to content

Commit

Permalink
zephyr: Add missing pthread library functions (#3291)
Browse files Browse the repository at this point in the history
For use with WAMR_BUILD_LIB_PTHREAD, add os_thread_detach,
os_thread_exit, os_cond_broadcast.

Signed-off-by: Maxim Kolchurin <[email protected]>
  • Loading branch information
mkolchurin authored Apr 10, 2024
1 parent bcc2a2d commit 8756d29
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion core/shared/platform/zephyr/zephyr_thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,4 +577,34 @@ os_thread_get_stack_boundary()

void
os_thread_jit_write_protect_np(bool enabled)
{}
{}

int
os_thread_detach(korp_tid thread)
{
(void)thread;
return BHT_OK;
}

void
os_thread_exit(void *retval)
{
(void)retval;
os_thread_cleanup();
k_thread_abort(k_current_get());
}

int
os_cond_broadcast(korp_cond *cond)
{
os_thread_wait_node *node;
k_mutex_lock(&cond->wait_list_lock, K_FOREVER);
node = cond->thread_wait_list;
while (node) {
os_thread_wait_node *next = node->next;
k_sem_give(&node->sem);
node = next;
}
k_mutex_unlock(&cond->wait_list_lock);
return BHT_OK;
}

0 comments on commit 8756d29

Please sign in to comment.