tsleep: Add a PNOLOCK flag

Add a PNOLOCK flag so that, in the race circumstance where
wakeup races are externally mitigated, tsleep() can be
called with a sleep time of 0 without triggering an
an assertion.

Reviewed by: jhb
Sponsored by: Netflix
This commit is contained in:
Andrew Gallatin 2021-08-05 17:16:30 -04:00 committed by Sebastian Huber
parent 356891f5e0
commit 4bf5c259d3
1 changed files with 5 additions and 3 deletions

View File

@ -153,9 +153,11 @@
((off_t)(db) << DEV_BSHIFT)
#endif
#define PRIMASK 0x0ff
#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
#define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */
#define PRIMASK 0x0ff
#define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
#define PDROP 0x200 /* OR'd with pri to stop re-entry of interlock mutex */
#define PNOLOCK 0x400 /* OR'd with pri to allow sleeping w/o a lock */
#define PRILASTFLAG 0x400 /* Last flag defined above */
#define NZERO 0 /* default "nice" */