PUSER has been used since the import of ___thrsleep(2) / librthread.
This value has been then copied to futex(2). No other tsleep(9) call
use this value. I'd like to stop using it to be able to differentiate
sleeping priorities that will be always < PUSER, to running priorities.
The only running priorities that could be < PUSER are the one of niced
programs like sndiod(9).
Ok?
Index: kern/kern_sig.c
===
RCS file: /cvs/src/sys/kern/kern_sig.c,v
retrieving revision 1.231
diff -u -p -r1.231 kern_sig.c
--- kern/kern_sig.c 21 Jun 2019 09:39:48 - 1.231
+++ kern/kern_sig.c 21 Jun 2019 20:15:12 -
@@ -2049,7 +2049,7 @@ single_thread_wait(struct process *pr)
{
/* wait until they're all suspended */
while (pr->ps_singlecount > 0)
- tsleep(>ps_singlecount, PUSER, "suspend", 0);
+ tsleep(>ps_singlecount, PWAIT, "suspend", 0);
}
void
Index: kern/kern_synch.c
===
RCS file: /cvs/src/sys/kern/kern_synch.c,v
retrieving revision 1.150
diff -u -p -r1.150 kern_synch.c
--- kern/kern_synch.c 3 Jul 2019 22:39:33 - 1.150
+++ kern/kern_synch.c 8 Jul 2019 16:36:40 -
@@ -644,7 +644,7 @@ thrsleep(struct proc *p, struct sys___th
void *sleepaddr = >p_thrslpid;
if (ident == -1)
sleepaddr =
- error = tsleep(sleepaddr, PUSER | PCATCH, "thrsleep",
+ error = tsleep(sleepaddr, PWAIT|PCATCH, "thrsleep",
(int)to_ticks);
}
Index: kern/sys_futex.c
===
RCS file: /cvs/src/sys/kern/sys_futex.c,v
retrieving revision 1.12
diff -u -p -r1.12 sys_futex.c
--- kern/sys_futex.c6 Feb 2019 15:11:20 - 1.12
+++ kern/sys_futex.c21 Jun 2019 20:15:57 -
@@ -254,7 +254,7 @@ futex_wait(uint32_t *uaddr, uint32_t val
TAILQ_INSERT_TAIL(>ft_threads, p, p_fut_link);
p->p_futex = f;
- error = rwsleep(p, , PUSER|PCATCH, "fsleep", (int)to_ticks);
+ error = rwsleep(p, , PWAIT|PCATCH, "fsleep", (int)to_ticks);
if (error == ERESTART)
error = ECANCELED;
else if (error == EWOULDBLOCK) {