changed to use sched_yield after critical section