pthread_yield() is nonstandard and not available on musl. Use the standardized sched_yield() instead.
pthread_yield()
sched_yield()