summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2005-05-27 15:57:27 +0000
committerdavidxu <davidxu@FreeBSD.org>2005-05-27 15:57:27 +0000
commit5a8d3af0d69b30a593d01746e0b29a2d8e7b18ed (patch)
treea913e40ac11aa7642e1977dd05fc7727b17a4f13
parent8af0c3680927f957286f95f98d498d611ebc5cf0 (diff)
downloadFreeBSD-src-5a8d3af0d69b30a593d01746e0b29a2d8e7b18ed.zip
FreeBSD-src-5a8d3af0d69b30a593d01746e0b29a2d8e7b18ed.tar.gz
Remove thread_upcall_check, it was used to avoid race bug in earlier
day's sleep queue code, today the bug no longer exists. please see 04/25/2004 freebsd-threads@ mailing list archive.
-rw-r--r--sys/kern/kern_kse.c10
-rw-r--r--sys/kern/subr_sleepqueue.c6
-rw-r--r--sys/sys/proc.h1
3 files changed, 1 insertions, 16 deletions
diff --git a/sys/kern/kern_kse.c b/sys/kern/kern_kse.c
index 9c492dd..feee12b 100644
--- a/sys/kern/kern_kse.c
+++ b/sys/kern/kern_kse.c
@@ -1427,16 +1427,6 @@ out:
return (error); /* go sync */
}
-int
-thread_upcall_check(struct thread *td)
-{
- PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
- if (td->td_kflags & TDK_WAKEUP)
- return (1);
- else
- return (0);
-}
-
/*
* called after ptrace resumed a process, force all
* virtual CPUs to schedule upcall for SA process,
diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c
index 6d1f1c2..44a2596 100644
--- a/sys/kern/subr_sleepqueue.c
+++ b/sys/kern/subr_sleepqueue.c
@@ -345,10 +345,8 @@ sleepq_catch_signals(void *wchan)
struct sleepqueue *sq;
struct thread *td;
struct proc *p;
- int do_upcall;
int sig;
- do_upcall = 0;
td = curthread;
p = td->td_proc;
sc = SC_LOOKUP(wchan);
@@ -370,8 +368,6 @@ sleepq_catch_signals(void *wchan)
mtx_unlock(&p->p_sigacts->ps_mtx);
if (sig == 0 && thread_suspend_check(1))
sig = SIGSTOP;
- else
- do_upcall = thread_upcall_check(td);
PROC_UNLOCK(p);
/*
@@ -383,7 +379,7 @@ sleepq_catch_signals(void *wchan)
sleepq_lock(wchan);
sq = sleepq_lookup(wchan);
mtx_lock_spin(&sched_lock);
- if (TD_ON_SLEEPQ(td) && (sig != 0 || do_upcall != 0))
+ if (TD_ON_SLEEPQ(td) && sig != 0)
sleepq_resume_thread(sq, td, -1);
else if (!TD_ON_SLEEPQ(td) && sig == 0)
td->td_flags &= ~TDF_SINTR;
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
index fdf77e5..2eed9e2 100644
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -928,7 +928,6 @@ struct thread *thread_switchout(struct thread *td, int flags,
void thread_unlink(struct thread *td);
void thread_unsuspend(struct proc *p);
void thread_unsuspend_one(struct thread *td);
-int thread_upcall_check(struct thread *td);
void thread_unthread(struct thread *td);
int thread_userret(struct thread *td, struct trapframe *frame);
void thread_user_enter(struct thread *td);
OpenPOWER on IntegriCloud