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)
committerJeremy Allison <jra@samba.org>
Sat, 6 Feb 2010 06:17:54 +0000 (22:17 -0800)
commit5dbf175c75bd6139f3238f36665000641f7f7f79
tree8d2d22ebed4f78f75bce96491efc8b1edf8ae3ab
parentdd498d2eecf124a03b6117ddab892a1112f9e9db
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