a proposed callout API

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Nov 14 18:31:52 UTC 2006


In message <20061114162658.ae168dcf.rnsanchez at wait4.org>, Ricardo Nabinger Sanc
hez writes:
>On Mon, 13 Nov 2006 20:53:41 +0000
>Poul-Henning Kamp <phk at 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 at 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.


More information about the freebsd-arch mailing list