await & asleep

M. Warner Losh imp at
Thu Jul 28 04:11:16 GMT 2005

In message: <42E7BD9F.6060401 at>
            Scott Long <scottl at> writes:
: > and the priority argument of tsleep() doesn't have any meaning
: > any longer, right?
: > 
: I thought it did, but John can give the definitive answer.

Priority is still useful.  It is the same priority that msleep uses.
tsleep is completely equivalent to msleep with a null mtx parameter.
The priority field is indeed used:

	 * Adjust this thread's priority.
	sched_prio(td, priority & PRIMASK);

msleep is a different primitive that cv_wait and friends.  cv_wait
enforces good mutex practices and generally should be used...


More information about the freebsd-hackers mailing list