aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2005-05-27 15:57:27 +0000
committerDavid Xu <davidxu@FreeBSD.org>2005-05-27 15:57:27 +0000
commit0cb7166f7811047c2d42add2b62e7169f968dc72 (patch)
treea913e40ac11aa7642e1977dd05fc7727b17a4f13
parentb0a7bd8e8835b968de897253ad7944d195c540e3 (diff)
downloadsrc-0cb7166f7811047c2d42add2b62e7169f968dc72.tar.gz
src-0cb7166f7811047c2d42add2b62e7169f968dc72.zip
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.
Notes
Notes: svn path=/head/; revision=146687
-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 9c492dd1f881..feee12b033aa 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 6d1f1c2d06a2..44a2596d29e6 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 fdf77e5ffeba..2eed9e2de2a3 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);