int _sched_yield(void) { struct pthread *curthread = _get_curthread(); if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) return (__sys_sched_yield()); /* Reset the accumulated time slice value for the current thread: */ curthread->slice_usec = -1; /* Schedule the next thread: */ _thr_sched_switch(curthread); /* Always return no error. */ return(0); }
/* Draft 4 yield */ void _pthread_yield(void) { struct pthread *curthread = _get_curthread(); if (curthread->attr.flags & PTHREAD_SCOPE_SYSTEM) { __sys_sched_yield(); return; } /* Reset the accumulated time slice value for the current thread: */ curthread->slice_usec = -1; /* Schedule the next thread: */ _thr_sched_switch(curthread); }
/* Draft 4 yield */ void _pthread_yield(void) { __sys_sched_yield(); }