PERFORCE change 1200929 for review
John Baldwin
jhb at FreeBSD.org
Mon Sep 29 19:31:39 UTC 2014
http://p4web.freebsd.org/@@1200929?ac=10
Change 1200929 by jhb at jhb_ralph on 2014/09/29 19:31:34
More edits.
Affected files ...
.. //depot/projects/smpng/share/man/man9/timeout.9#16 edit
Differences ...
==== //depot/projects/smpng/share/man/man9/timeout.9#16 (text+ko) ====
@@ -132,8 +132,8 @@
This is normally done by rescheduling the subsequent call within the called
function.
.Pp
-Callout functions are not permitted to sleep.
-They may not acquire any sleepable locks,
+Callout functions must not sleep.
+They may not acquire sleepable locks,
wait on condition variables,
perform blocking allocation requests,
or invoke any other action that might sleep.
@@ -172,19 +172,16 @@
or
.Fa rw
parameter.
+The associated lock must be held while stopping or rescheduling the
+callout.
The callout subsystem acquires the associated lock before calling the
-callout function.
-The subsystem then checks if the pending callout was cancelled
-while it waited for the associated lock.
-If the callout was cancelled,
+callout function and releases it after the function returns.
+If the callout was cancelled while the callout subsystem waited for the
+associated lock,
the callout function is not called and the associated lock is released.
-If the callout was not cancelled,
-the callout function is called and the associated lock is released by the
-subsystem after the callout function returns.
-The callout must only be cancelled or rescheduled while holding the
-associated lock.
-This guarantees that stopping or rescheduling a callout associated with a
-lock will not race with the callout function itself.
+This guarantees that stopping or rescheduling the callout will not race with
+the callout function itself because the associated lock must be held to
+stop or reschedule the callout.
.Pp
Only regular mutexes may be used with
.Fn callout_init_mtx ;
More information about the p4-projects
mailing list