s3-events: make the old timed events compatible with tevent
authorAndrew Tridgell <tridge@samba.org>
Sat, 6 Feb 2010 03:14:45 +0000 (19:14 -0800)
committerKarolin Seeger <kseeger@samba.org>
Wed, 31 Mar 2010 15:53:13 +0000 (17:53 +0200)
commit380e86e0f9c9314f4f69528227668dbbb222b144
tree514c4bbaa077282702980ce242d48473731f8eeb
parent9620f5fbe64910d86cae51345156a1a4dd71e231
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.
(cherry picked from commit 5dbf175c75bd6139f3238f36665000641f7f7f79)
source3/lib/events.c