Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2006 18:31:45 +0000
From:      "Poul-Henning Kamp" <phk@phk.freebsd.dk>
To:        Ricardo Nabinger Sanchez <rnsanchez@wait4.org>
Cc:        arch@freebsd.org
Subject:   Re: a proposed callout API 
Message-ID:  <12465.1163529105@critter.freebsd.dk>
In-Reply-To: Your message of "Tue, 14 Nov 2006 16:26:58 -0200." <20061114162658.ae168dcf.rnsanchez@wait4.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20061114162658.ae168dcf.rnsanchez@wait4.org>, Ricardo Nabinger Sanc
hez writes:
>On Mon, 13 Nov 2006 20:53:41 +0000
>Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:
>
>> XXX_disarm(struct xxx*)
>> 	Unarm the timer.
>> 
>> XXX_drain(struct xxx*)
>> 	Drain the timer.
>
>One of these (or both) removes a callout from the tree?  I don't quite
>understand their differences.


disarm disables the callout, it will not be called again after the
disarm call returns, and it will not be rescheduled if it is currently
running.

drain does not return until the callout has completed running, if it
is currently active.

The two-phase teardown is necessary where a mutex is held during
the callout execution.

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?12465.1163529105>