cvs commit: src/sys/netinet sctp_bsd_addr.c

Bruce Evans brde at optusnet.com.au
Tue Jan 1 15:39:42 PST 2008


On Tue, 1 Jan 2008, M. Warner Losh wrote:

> In message: <20080101161858.A10345 at delplex.bde.org>
>            Bruce Evans <brde at optusnet.com.au> writes:
> : PZERO is compatibility cruft which should never be used.  Just a few
> ...
>
> Do we want to document the other Pxxxx priorities?

Maybe, but not in sleep.9.  I just learn about them from *.[ch].

> : Otherwise, PZERO has a completely different meaning from either priority
> : 0 (maximal) or the bare 0 arg to msleep.  It means some middle priority,
> ...

> So would the following be a reasonable change to sleep.9?
>
> Index: sleep.9
> ===================================================================
> RCS file: /home/ncvs/src/share/man/man9/sleep.9,v
> retrieving revision 1.61
> diff -u -r1.61 sleep.9
> --- sleep.9     30 Mar 2007 18:07:26 -0000      1.61
> +++ sleep.9     1 Jan 2008 09:44:01 -0000
> @@ -93,6 +93,10 @@
> runnable with the specified
> .Fa priority
> when it resumes.
> +.Dv PZERO
> +should never be used, as it is for compatibility only.
> +A new priority of 0 means to use the thread's current priority when
> +it is made runnable again.
> If
> .Fa priority
> includes the

Not quite.  The sentence about PZERO doesn't belong here.  The 2 sentences
bfore the PZERO sentence already completely document the specialness of
priority 0:

% .Pp
% The parameter
% .Fa priority
% specifies a new priority for the thread as well as some optional flags.
% If the new priority is not 0,
% then the thread will be made
% runnable with the specified
% .Fa priority
% when it resumes.

If this is not clear, then I think it should be made clearer by rewording
it and not by tacking on a modifying clause.  My attempt:

%%%
.Pp
The parameter
.Fa priority
encodes the new priority for the thread and some optional flags.
The thread will be made runnable with the new priority when it resumes.
The new priority is determined from
.Fa priority
by first masking out the flags using the
.Dv PRIMASK
mask.
If the the result of this is nonzero, then it gives the new priority;
otherwise, the new priority is same as the current priority.
%%%

BTW, grep shows that PZERO is only documented in spl.9 of all places,
only in examples using the even-more-deprecated tsleep(), while sleep.9
doesn't have any examples.

Bruce


More information about the cvs-src mailing list