diff options
author | bde <bde@FreeBSD.org> | 2004-05-14 20:51:42 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2004-05-14 20:51:42 +0000 |
commit | 802b835b3dce9f01d88d8138d102bed0ec35b524 (patch) | |
tree | f0af971960bca6e2b4a6e0fb08a00de62ecd8115 /sys/kern/kern_synch.c | |
parent | 9d75d5e3a570a2d9da34b9cdd60eb4ce488a9073 (diff) | |
download | FreeBSD-src-802b835b3dce9f01d88d8138d102bed0ec35b524.zip FreeBSD-src-802b835b3dce9f01d88d8138d102bed0ec35b524.tar.gz |
Fixed some common printf format errors. Don't assume that "struct foo *"
is "void *" (it isn't) or that the default promotion of pid_t is int.
Instead, assume that casting "struct foo *" to "void *" and printing the
result with %p is useful, and that all pid_t's are representable as longs.
Fixed some minor style bugs (mainly spelling errors in comments).
Diffstat (limited to 'sys/kern/kern_synch.c')
-rw-r--r-- | sys/kern/kern_synch.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 280f24f..9fa44bd 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -118,7 +118,6 @@ sleepinit(void) * entered before msleep returns. If priority includes the PDROP * flag the mutex is not entered before returning. */ - int msleep(ident, mtx, priority, wmesg, timo) void *ident; @@ -148,8 +147,8 @@ msleep(ident, mtx, priority, wmesg, timo) if (cold) { /* * During autoconfiguration, just return; - * don't run any other procs or panic below, - * in case this is the idle process and already asleep. + * don't run any other threads or panic below, + * in case this is the idle thread and already asleep. * XXX: this used to do "s = splhigh(); splx(safepri); * splx(s);" to give interrupts a chance, but there is * no way to give interrupts a chance now. @@ -199,8 +198,8 @@ msleep(ident, mtx, priority, wmesg, timo) } } mtx_unlock_spin(&sched_lock); - CTR5(KTR_PROC, "msleep: thread %p (pid %d, %s) on %s (%p)", - td, p->p_pid, p->p_comm, wmesg, ident); + CTR5(KTR_PROC, "msleep: thread %p (pid %ld, %s) on %s (%p)", + (void *)td, (long)p->p_pid, p->p_comm, wmesg, ident); DROP_GIANT(); if (mtx != NULL) { @@ -233,9 +232,9 @@ msleep(ident, mtx, priority, wmesg, timo) sig = 0; /* - * Adjust this threads priority. + * Adjust this thread's priority. * - * XXX: Do we need to save priority in td_base_pri? + * XXX: do we need to save priority in td_base_pri? */ mtx_lock_spin(&sched_lock); sched_prio(td, priority & PRIMASK); @@ -251,10 +250,6 @@ msleep(ident, mtx, priority, wmesg, timo) sleepq_wait(ident); rval = 0; } - - /* - * We're awake from voluntary sleep. - */ if (rval == 0 && catch) rval = sleepq_calc_signal_retval(sig); #ifdef KTRACE @@ -270,7 +265,7 @@ msleep(ident, mtx, priority, wmesg, timo) } /* - * Make all processes sleeping on the specified identifier runnable. + * Make all threads sleeping on the specified identifier runnable. */ void wakeup(ident) @@ -281,8 +276,8 @@ wakeup(ident) } /* - * Make a process sleeping on the specified identifier runnable. - * May wake more than one process if a target process is currently + * Make a thread sleeping on the specified identifier runnable. + * May wake more than one thread if a target thread is currently * swapped out. */ void @@ -294,7 +289,7 @@ wakeup_one(ident) } /* - * The machine independent parts of mi_switch(). + * The machine independent parts of context switching. */ void mi_switch(int flags) @@ -357,14 +352,14 @@ mi_switch(int flags) cnt.v_swtch++; PCPU_SET(switchtime, new_switchtime); PCPU_SET(switchticks, ticks); - CTR3(KTR_PROC, "mi_switch: old thread %p (pid %d, %s)", td, p->p_pid, - p->p_comm); + CTR3(KTR_PROC, "mi_switch: old thread %p (pid %ld, %s)", + (void *)td, (long)p->p_pid, p->p_comm); if (td->td_proc->p_flag & P_SA) thread_switchout(td); sched_switch(td); - CTR3(KTR_PROC, "mi_switch: new thread %p (pid %d, %s)", td, p->p_pid, - p->p_comm); + CTR3(KTR_PROC, "mi_switch: new thread %p (pid %ld, %s)", + (void *)td, (long)p->p_pid, p->p_comm); /* * If the last thread was exiting, finish cleaning it up. |