s3-events: make the old timed events compatible with tevent
authorAndrew Tridgell <tridge@samba.org>
Fri, 5 Feb 2010 03:25:03 +0000 (14:25 +1100)
committerMichael Adam <obnox@samba.org>
Wed, 10 Mar 2010 12:22:31 +0000 (13:22 +0100)
commit97c2c6e16218f64e5c3f10287031cd4f62a6eeb5
tree0032e7a07b2e80fcf10b584ef95b1df8e9feec03
parent94d8813b68e270b7a5fe456e74b7a1c9611019e7
s3-events: make the old timed events compatible with tevent

tevent ensures that a timed event is only called once. The old events
code relied on the called handler removing the event itself. If the
handler removed the event after calling a function which invoked the
event loop then the timed event could loop forever.

This change makes the two timed event systems more compatible, by
allowing the handler to free the te if it wants to, but ensuring it is
off the linked list of events before the handler is called, and
ensuring it is freed even if the handler doesn't free it.
source3/lib/events.c