Changeset View
Changeset View
Standalone View
Standalone View
head/share/man/man9/timeout.9
Show All 23 Lines | |||||
.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||||
.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||||
.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | .\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||||
.\" POSSIBILITY OF SUCH DAMAGE. | .\" POSSIBILITY OF SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" $FreeBSD$ | .\" $FreeBSD$ | ||||
.\" | .\" | ||||
.Dd September 14, 2015 | .Dd July 4, 2016 | ||||
.Dt TIMEOUT 9 | .Dt TIMEOUT 9 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm callout_active , | .Nm callout_active , | ||||
.Nm callout_deactivate , | .Nm callout_deactivate , | ||||
.Nm callout_async_drain , | .Nm callout_async_drain , | ||||
.Nm callout_drain , | .Nm callout_drain , | ||||
.Nm callout_handle_init , | .Nm callout_handle_init , | ||||
▲ Show 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | |||||
If the callout is pending and successfully stopped, then | If the callout is pending and successfully stopped, then | ||||
.Fn callout_stop | .Fn callout_stop | ||||
returns a value of one. | returns a value of one. | ||||
If the callout is not set, or | If the callout is not set, or | ||||
has already been serviced, then | has already been serviced, then | ||||
negative one is returned. | negative one is returned. | ||||
If the callout is currently being serviced and cannot be stopped, | If the callout is currently being serviced and cannot be stopped, | ||||
then zero will be returned. | then zero will be returned. | ||||
If the callout is currently being serviced and cannot be stopped, and at the | |||||
same time a next invocation of the same callout is also scheduled, then | |||||
.Fn callout_stop | |||||
unschedules the next run and returns zero. | |||||
If the callout has an associated lock, | If the callout has an associated lock, | ||||
then that lock must be held when this function is called. | then that lock must be held when this function is called. | ||||
.Pp | .Pp | ||||
The function | The function | ||||
.Fn callout_async_drain | .Fn callout_async_drain | ||||
is identical to | is identical to | ||||
.Fn callout_stop | .Fn callout_stop | ||||
with one difference. | with one difference. | ||||
▲ Show 20 Lines • Show All 551 Lines • ▼ Show 20 Lines | |||||
function invocation was scheduled. | function invocation was scheduled. | ||||
.Pp | .Pp | ||||
The | The | ||||
.Fn callout_stop | .Fn callout_stop | ||||
and | and | ||||
.Fn callout_drain | .Fn callout_drain | ||||
functions return a value of one if the callout was still pending when it was | functions return a value of one if the callout was still pending when it was | ||||
called, a zero if the callout could not be stopped and a negative one is it | called, a zero if the callout could not be stopped and a negative one is it | ||||
was either not running or haas already completed. | was either not running or has already completed. | ||||
The | The | ||||
.Fn timeout | .Fn timeout | ||||
function returns a | function returns a | ||||
.Ft struct callout_handle | .Ft struct callout_handle | ||||
that can be passed to | that can be passed to | ||||
.Fn untimeout . | .Fn untimeout . | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The current timeout and untimeout routines are based on the work of | The current timeout and untimeout routines are based on the work of | ||||
Show All 23 Lines |