diff --git a/kernel/futex.c b/kernel/futex.c index 5e9ddcca..929407a1 100644 --- a/kernel/futex.c +++ b/kernel/futex.c @@ -79,8 +79,6 @@ #define dkprintf(...) do { if (0) kprintf(__VA_ARGS__); } while (0) #endif -extern struct sigpending *hassigpending(struct thread *thread); - int futex_cmpxchg_enabled; /** diff --git a/kernel/include/process.h b/kernel/include/process.h index eab37eee..7196b2cc 100644 --- a/kernel/include/process.h +++ b/kernel/include/process.h @@ -677,5 +677,6 @@ void chain_process(struct process *); void chain_thread(struct thread *); void proc_init(); void set_timer(); +struct sig_pending *hassigpending(struct thread *thread); #endif diff --git a/kernel/process.c b/kernel/process.c index 941c1d89..2e5570de 100644 --- a/kernel/process.c +++ b/kernel/process.c @@ -2593,9 +2593,10 @@ redo: if (v->flags & CPU_FLAG_NEED_MIGRATE) { next = &cpu_local_var(idle); } else { - /* Pick a new running process */ + /* Pick a new running process or one that has a pending signal */ list_for_each_entry_safe(thread, tmp, &(v->runq), sched_list) { - if (thread->status == PS_RUNNING) { + if (thread->status == PS_RUNNING || + (thread->status == PS_INTERRUPTIBLE && hassigpending(thread))) { next = thread; break; } diff --git a/kernel/syscall.c b/kernel/syscall.c index 79444fb7..864a6499 100644 --- a/kernel/syscall.c +++ b/kernel/syscall.c @@ -105,7 +105,6 @@ static void calculate_time_from_tsc(struct timespec *ts); void check_signal(unsigned long, void *, int); void do_signal(long rc, void *regs, struct thread *thread, struct sig_pending *pending, int num); extern unsigned long do_kill(struct thread *thread, int pid, int tid, int sig, struct siginfo *info, int ptracecont); -extern struct sigpending *hassigpending(struct thread *thread); extern long alloc_debugreg(struct thread *thread); extern int num_processors; extern unsigned long ihk_mc_get_ns_per_tsc(void);