- Remove old sleep queues.

- Remove sleepqueue argument from sleepq_set_timeout() since it is not
  used.
This commit is contained in:
John Baldwin 2004-03-12 19:06:18 +00:00
parent 595bc82a1d
commit 1ed3e44f22
4 changed files with 5 additions and 17 deletions

View File

@ -245,7 +245,7 @@ cv_timedwait(struct cv *cvp, struct mtx *mp, int timo)
mtx_unlock(mp); mtx_unlock(mp);
sleepq_add(sq, cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR); sleepq_add(sq, cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR);
sleepq_set_timeout(sq, cvp, timo); sleepq_set_timeout(cvp, timo);
rval = sleepq_timedwait(cvp, 0); rval = sleepq_timedwait(cvp, 0);
#ifdef KTRACE #ifdef KTRACE
@ -303,7 +303,7 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo)
mtx_unlock(mp); mtx_unlock(mp);
sleepq_add(sq, cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR); sleepq_add(sq, cvp, mp, cvp->cv_description, SLEEPQ_CONDVAR);
sleepq_set_timeout(sq, cvp, timo); sleepq_set_timeout(cvp, timo);
sig = sleepq_catch_signals(cvp); sig = sleepq_catch_signals(cvp);
/* /*
* XXX: Missing magic return value handling for no signal * XXX: Missing magic return value handling for no signal

View File

@ -99,23 +99,11 @@ SYSCTL_INT(_kern, OID_AUTO, fscale, CTLFLAG_RD, 0, FSCALE, "");
static void loadav(void *arg); static void loadav(void *arg);
static void lboltcb(void *arg); static void lboltcb(void *arg);
/*
* We're only looking at 7 bits of the address; everything is
* aligned to 4, lots of things are aligned to greater powers
* of 2. Shift right by 8, i.e. drop the bottom 256 worth.
*/
#define TABLESIZE 128
static TAILQ_HEAD(slpquehead, thread) slpque[TABLESIZE];
#define LOOKUP(x) (((intptr_t)(x) >> 8) & (TABLESIZE - 1))
void void
sleepinit(void) sleepinit(void)
{ {
int i;
hogticks = (hz / 10) * 2; /* Default only. */ hogticks = (hz / 10) * 2; /* Default only. */
for (i = 0; i < TABLESIZE; i++)
TAILQ_INIT(&slpque[i]);
init_sleepqueues(); init_sleepqueues();
} }
@ -236,7 +224,7 @@ msleep(ident, mtx, priority, wmesg, timo)
*/ */
sleepq_add(sq, ident, mtx, wmesg, 0); sleepq_add(sq, ident, mtx, wmesg, 0);
if (timo) if (timo)
sleepq_set_timeout(sq, ident, timo); sleepq_set_timeout(ident, timo);
if (catch) { if (catch) {
sig = sleepq_catch_signals(ident); sig = sleepq_catch_signals(ident);
if (sig == 0 && !TD_ON_SLEEPQ(td)) { if (sig == 0 && !TD_ON_SLEEPQ(td)) {

View File

@ -267,7 +267,7 @@ sleepq_add(struct sleepqueue *sq, void *wchan, struct mtx *lock,
* sleep queue after timo ticks if the thread has not already been awakened. * sleep queue after timo ticks if the thread has not already been awakened.
*/ */
void void
sleepq_set_timeout(struct sleepqueue *sq, void *wchan, int timo) sleepq_set_timeout(void *wchan, int timo)
{ {
struct sleepqueue_chain *sc; struct sleepqueue_chain *sc;
struct thread *td; struct thread *td;

View File

@ -97,7 +97,7 @@ struct sleepqueue *sleepq_lookup(void *);
void sleepq_release(void *); void sleepq_release(void *);
void sleepq_remove(struct thread *, void *); void sleepq_remove(struct thread *, void *);
void sleepq_signal(void *, int, int); void sleepq_signal(void *, int, int);
void sleepq_set_timeout(struct sleepqueue *sq, void *wchan, int timo); void sleepq_set_timeout(void *wchan, int timo);
int sleepq_timedwait(void *wchan, int signal_caught); int sleepq_timedwait(void *wchan, int signal_caught);
int sleepq_timedwait_sig(void *wchan, int signal_caught); int sleepq_timedwait_sig(void *wchan, int signal_caught);
void sleepq_wait(void *); void sleepq_wait(void *);