コード例 #1
0
ファイル: thr_yield.c プロジェクト: 5432935/crossbridge
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);
}
コード例 #2
0
ファイル: thr_yield.c プロジェクト: 5432935/crossbridge
/* 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);
}
コード例 #3
0
/* Draft 4 yield */
void
_pthread_yield(void)
{
    __sys_sched_yield();
}