diff options
author | jhb <jhb@FreeBSD.org> | 2000-12-15 20:39:35 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2000-12-15 20:39:35 +0000 |
commit | 656396e81a09897de7bc5b03a489970469295171 (patch) | |
tree | 6a57ad1c786c6dc555751f1116f2ec6243f538f5 /share/man/man9/kthread.9 | |
parent | 82f46e482726717653f27ff10d0792c13b75e4ab (diff) | |
download | FreeBSD-src-656396e81a09897de7bc5b03a489970469295171.zip FreeBSD-src-656396e81a09897de7bc5b03a489970469295171.tar.gz |
Catch up to the changes to the kthread API.
Diffstat (limited to 'share/man/man9/kthread.9')
-rw-r--r-- | share/man/man9/kthread.9 | 71 |
1 files changed, 43 insertions, 28 deletions
diff --git a/share/man/man9/kthread.9 b/share/man/man9/kthread.9 index 65adef9..e894c3a 100644 --- a/share/man/man9/kthread.9 +++ b/share/man/man9/kthread.9 @@ -30,29 +30,29 @@ .Os .Sh NAME .Nm kproc_start , -.Nm kproc_suspend_loop , +.Nm kproc_shutdown , .Nm kthread_create , .Nm kthread_exit , -.Nm resume_kproc , -.Nm shutdown_kproc , -.Nm suspend_kproc +.Nm kthread_resume , +.Nm kthread_suspend , +.Nm kthread_suspend_check .Nd kernel threads .Sh SYNOPSIS .Fd #include <sys/kthread.h> .Ft void .Fn kproc_start "const void *udata" .Ft void -.Fn kproc_suspend_loop "struct proc *p" +.Fn kproc_shutdown "void *arg" "int howto" .Ft int .Fn kthread_create "void (*func)(void *)" "void *arg" "struct proc **newpp" "int flags" "const char *fmt" "..." .Ft void .Fn kthread_exit "int ecode" .Ft int -.Fn resume_kproc "struct proc *p" -.Ft void -.Fn shutdown_kproc "void *arg" "int howto" +.Fn kthread_resume "struct proc *p" .Ft int -.Fn suspend_kproc "struct proc *p" "int timo" +.Fn kthread_suspend "struct proc *p" "int timo" +.Ft void +.Fn kthread_suspend_check "struct proc *p" .Sh DESCRIPTION .Pp The function @@ -140,14 +140,14 @@ The argument specifies the exit status of the thread. .Pp The -.Fn kproc_suspend_loop , -.Fn resume_kproc , +.Fn kthread_resume , +.Fn kthread_suspend , and -.Fn suspend_kproc +.Fn kthread_suspend_check functions are used to suspend and resume a kernel thread. During the main loop of its execution, a kernel thread that wishes to allow itself to be suspended should call -.Fn kproc_suspend_loop +.Fn kthread_suspend_check passing in .Va curproc as the only argument. @@ -165,25 +165,25 @@ argument points to the .Li struct proc of the kernel thread to suspend or resume. For -.Fn suspend_kproc , +.Fn kthread_suspend , the .Fa timo argument specifies a timeout to wait for the kernel thread to acknowledge the suspend request and suspend itself. .Pp The -.Fn shutdown_kproc +.Fn kproc_shutdown function is meant to be registered as a shutdown event for kernel threads that need to be suspended voluntarily during system shutdown so as not to interfere with system shutdown activities. The actual suspension of the kernel thread is done with -.Fn suspend_kproc . +.Fn kthread_suspend . .Sh RETURN VALUES The .Fn kthread_create , -.Fn resume_kproc , +.Fn kthread_resume , and -.Fn suspend_kproc +.Fn kthread_suspend functions return zero on success and non-zero on failure. Upon failure, the global variable .Va errno @@ -193,9 +193,9 @@ This example demonstrates the use of a .Li struct kproc_desc and the functions .Fn kproc_start , -.Fn shutdown_kproc, +.Fn kproc_shutdown , and -.Fn kproc_suspend_loop +.Fn kthread_suspend_check to run the .Dq bufdaemon process. @@ -217,20 +217,20 @@ buf_daemon() /* * This process needs to be suspended prior to shutdown sync. */ - EVENTHANDLER_REGISTER(shutdown_pre_sync, shutdown_kproc, + EVENTHANDLER_REGISTER(shutdown_pre_sync, kproc_shutdown, bufdaemonproc, SHUTDOWN_PRI_LAST); ... for (;;) { - kproc_suspend_loop(bufdaemonproc); + kthread_suspend_check(bufdaemonproc); ... } } .Ed .Sh ERRORS The -.Fn resume_kproc +.Fn kthread_resume and -.Fn suspend_kproc +.Fn kthread_suspend functions will fail if: .Bl -tag -width Er .It Bq Er EINVAL @@ -265,15 +265,30 @@ The function first appeared in .Fx 2.2 . The -.Fn kproc_suspend_loop , +.Fn kproc_shutdown , .Fn kthread_create , .Fn kthread_exit , -.Fn resume_kproc , -.Fn shutdown_kproc , +.Fn kthread_resume , +.Fn kthread_suspend , and -.Fn suspend_kproc +.Fn kthread_suspend_check functions were introducted in .Fx 4.0 . +Prior to +.Fx 5.0 , +the +.Fn kproc_shutdown , +.Fn kthread_resume , +.Fn kthread_suspend , +and +.Fn kthread_suspend_check +functions were named +.Fn shutdown_kproc , +.Fn resume_kproc , +.Fn shutdown_kproc , +and +.Fn kproc_suspend_loop , +respectively. .Sh BUGS If a kernel thread exits its main function (specified as the .Fa func |