From 97c033161b3dd307765e007a6cb2c7211de57d0f Mon Sep 17 00:00:00 2001 From: jhb Date: Thu, 7 Aug 2008 20:47:01 +0000 Subject: Document the new return values for sleepq_abort(), sleepq_broadcast(), and sleepq_signal(). Prodded by: attilio --- share/man/man9/sleepqueue.9 | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/man/man9/sleepqueue.9 b/share/man/man9/sleepqueue.9 index f0654d5..e2e3a4b 100644 --- a/share/man/man9/sleepqueue.9 +++ b/share/man/man9/sleepqueue.9 @@ -51,13 +51,13 @@ .In sys/sleepqueue.h .Ft void .Fn init_sleepqueues "void" -.Ft void +.Ft int .Fn sleepq_abort "struct thread *td" .Ft void .Fn sleepq_add "void *wchan" "struct lock_object *lock" "const char *wmesg" "int flags" "int queue" .Ft struct sleepqueue * .Fn sleepq_alloc "void" -.Ft void +.Ft int .Fn sleepq_broadcast "void *wchan" "int flags" "int pri" "int queue" .Ft int .Fn sleepq_calc_signal_retval "int sig" @@ -73,7 +73,7 @@ .Fn sleepq_release "void *wchan" .Ft void .Fn sleepq_remove "struct thread *td" "void *wchan" -.Ft void +.Ft int .Fn sleepq_signal "void *wchan" "int flags" "int pri" "int queue" .Ft void .Fn sleepq_set_timeout "void *wchan" "int timo" @@ -347,6 +347,21 @@ sufficient. One possible use is waking up a specific thread from a widely shared sleep channel. .Pp +The +.Fn sleepq_abort , +.Fn sleepq_broadcast , +and +.Fn sleepq_signal +functions all return a boolean value. +If the return value is true, +then at least one thread was resumed that is currently swapped out. +The caller is responsible for awakening the scheduler process so that the +resumed thread will be swapped back in. +This is done by calling the +.Fn kick_proc0 +function after releasing the sleep queue chain lock via a call to +.Fn sleepq_release . +.Pp The sleep queue interface is currently used to implement the .Xr sleep 9 and -- cgit v1.1