Date: Fri, 28 Aug 2015 07:31:20 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r287248 - in projects/hps_head: share/man/man9 sys/kern Message-ID: <201508280731.t7S7VKbj033651@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Fri Aug 28 07:31:19 2015 New Revision: 287248 URL: https://svnweb.freebsd.org/changeset/base/287248 Log: Revert r287194 due to coming changes in -current. Modified: projects/hps_head/share/man/man9/timeout.9 projects/hps_head/sys/kern/kern_timeout.c Modified: projects/hps_head/share/man/man9/timeout.9 ============================================================================== --- projects/hps_head/share/man/man9/timeout.9 Fri Aug 28 06:41:40 2015 (r287247) +++ projects/hps_head/share/man/man9/timeout.9 Fri Aug 28 07:31:19 2015 (r287248) @@ -246,8 +246,9 @@ argument. The number of ticks in a second is defined by .Dv hz and can vary from system to system. -This function has the same return value like -.Fn callout_stop . +This function returns a non-zero value if the given callout was pending and +the callback function was prevented from being called. +Otherwise, a value of zero is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, this @@ -482,25 +483,17 @@ is undefined. This function is used to stop a timeout function invocation associated with the callout pointed to by the .Fa c argument, in a non-blocking fashion. -This function can be called multiple times in a row with no side effects, even if the callout is already stopped. -This function however should not be called before the callout has been initialized. +This function can be called multiple times in a row with no side effects, even if the callout is already stopped. This function however should not be called before the callout has been initialized. +This function returns a non-zero value if the given callout was pending and +the callback function was prevented from being called. +Else a value of zero is returned. If a lock is associated with the callout given by the .Fa c argument and it is exclusivly locked when this function is called, the .Fn callout_stop function will always ensure that the callback function is never reached. In other words the callout will be atomically stopped. -When a callout is atomically stopped a return value of non-zero is returned. -Else a value of zero is returned. -If there is no lock associated with the callout given by the -.Fa c -argument the return values are slightly different. -If the callout was stopped ahead of the callback function a return -value of non-zero is returned. -If the callback function is currently executing and also if the -callout was restarted before being stopped again, a return value of -zero is returned. -In all other cases a value of zero is returned. +Else there is no such guarantee. .Sh DRAINING CALLOUTS .Ft int .Fn callout_drain "struct callout *c" Modified: projects/hps_head/sys/kern/kern_timeout.c ============================================================================== --- projects/hps_head/sys/kern/kern_timeout.c Fri Aug 28 06:41:40 2015 (r287247) +++ projects/hps_head/sys/kern/kern_timeout.c Fri Aug 28 07:31:19 2015 (r287248) @@ -1028,19 +1028,8 @@ callout_restart_async(struct callout *c, */ if (cc_exec_cancel(cc, direct) == false || (c->c_flags & CALLOUT_DEFRESTART) != 0) { - /* - * MPSAFE callouts should not return they were - * cancelled when the callback is scheduled - * for completion. Even if a deferred callback - * was actually stopped. This helps MPSAFE - * clients decide when they have a pending - * callback or not. - */ cc_exec_cancel(cc, direct) = true; - if (c->c_lock == NULL) - cancelled = CALLOUT_RET_NORMAL; - else - cancelled = CALLOUT_RET_CANCELLED; + cancelled = CALLOUT_RET_CANCELLED; } else { cancelled = CALLOUT_RET_NORMAL; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201508280731.t7S7VKbj033651>