示例#1
0
int
cloudabi_sys_thread_exit(struct thread *td,
    struct cloudabi_sys_thread_exit_args *uap)
{
	struct cloudabi_sys_lock_unlock_args cloudabi_sys_lock_unlock_args = {
		.lock = uap->lock,
		.scope = uap->scope,
	};

	umtx_thread_exit(td);

        /* Wake up joining thread. */
	cloudabi_sys_lock_unlock(td, &cloudabi_sys_lock_unlock_args);

        /*
	 * Attempt to terminate the thread. Terminate the process if
	 * it's the last thread.
	 */
	kern_thr_exit(td);
	exit1(td, 0, 0);
	/* NOTREACHED */
}

int
cloudabi_sys_thread_yield(struct thread *td,
    struct cloudabi_sys_thread_yield_args *uap)
{

	sched_relinquish(td);
	return (0);
}
示例#2
0
int
sys_sched_yield(struct thread *td, struct sched_yield_args *uap)
{

	sched_relinquish(curthread);
	return 0;
}
示例#3
0
/* ksched_yield: Yield the CPU.
 */
int
ksched_yield(struct ksched *ksched)
{
	sched_relinquish(curthread);
	return 0;
}