RTDECL(bool) RTThreadYield(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20) yield(); #else set_current_state(TASK_RUNNING); sys_sched_yield(); schedule(); #endif return true; }
RTDECL(bool) RTThreadYield(void) { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 20) yield(); #else /** @todo r=ramshankar: Can we use cond_resched() instead? */ set_current_state(TASK_RUNNING); sys_sched_yield(); schedule(); #endif return true; }
/* Signal handler to help us recover from dying while we are attached to * other threads. */ static void SignalHandler(int signum, siginfo_t *si, void *data) { if (sig_pids != NULL) { if (signum == SIGABRT) { while (sig_num_threads-- > 0) { /* Not sure if sched_yield is really necessary here, but it does not */ /* hurt, and it might be necessary for the same reasons that we have */ /* to do so in sys_ptrace_detach(). */ sys_sched_yield(); sys_ptrace(PTRACE_KILL, sig_pids[sig_num_threads], 0, 0); } } else if (sig_num_threads > 0) { ResumeAllProcessThreads(sig_num_threads, (int *)sig_pids); } } sig_pids = NULL; if (sig_marker >= 0) NO_INTR(sys_close(sig_marker)); sig_marker = -1; if (sig_proc >= 0) NO_INTR(sys_close(sig_proc)); sig_proc = -1; sys__exit(signum == SIGABRT ? 1 : 2); }
int sched_yield(void) { return sys_sched_yield(); }