On Tue, 14 Mar 2023 15:50:39 -0700 Tyler Retzlaff <roret...@linux.microsoft.com> wrote:
> + /* Wait for the thread wrapper to initialize thread successfully */ > + while ((thread_wrapper_status = > + __atomic_load_n(&ctx->thread_wrapper_status, > + __ATOMIC_ACQUIRE)) == THREAD_WRAPPER_LAUNCHING) > + sched_yield(); Using pthread condition variable would be better, and avoid using sched_yield() which is deprecated and not guaranteed to work in cases where threads have different priority.