diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-23 11:49:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:08 -0500 |
commit | fd62df64188c0f992876c72fdda8a6da5dba3090 (patch) | |
tree | a5f212e796816c648a3a0e49caa457eb597e292b /source4/ntvfs/posix/pvfs_wait.c | |
parent | 54eff1435dd69d489ae35834f17989f79011418e (diff) | |
download | samba-fd62df64188c0f992876c72fdda8a6da5dba3090.tar.gz samba-fd62df64188c0f992876c72fdda8a6da5dba3090.tar.xz samba-fd62df64188c0f992876c72fdda8a6da5dba3090.zip |
r4943: Smplified the events handling code a lot. The first source of
complexity was that events didn't automatically cleanup
themselves. This was because the events code was written before we had
talloc destructors, so you needed to call event_remove_XX() to clean
the event out of the event lists from every piece of code that used
events. I have now added automatic event destructors, which in turn
allowed me to simplify a lot of the calling code.
The 2nd source of complexity was caused by the ref_count, which was
needed to cope with event handlers destroying events while handling
them, which meant the linked lists became invalid, so the ref_count ws
used to mark events for later destruction.
The new system is much simpler. I now have a ev->destruction_count,
which is incremented in all event destructors. The event dispatch code
checks for changes to this and handles it.
(This used to be commit a3c7417cfeab429ffb22d5546b205818f531a7b4)
Diffstat (limited to 'source4/ntvfs/posix/pvfs_wait.c')
-rw-r--r-- | source4/ntvfs/posix/pvfs_wait.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source4/ntvfs/posix/pvfs_wait.c b/source4/ntvfs/posix/pvfs_wait.c index 4b757e0be1..e4175ca8cc 100644 --- a/source4/ntvfs/posix/pvfs_wait.c +++ b/source4/ntvfs/posix/pvfs_wait.c @@ -105,7 +105,6 @@ static int pvfs_wait_destructor(void *ptr) { struct pvfs_wait *pwait = ptr; messaging_deregister(pwait->msg_ctx, pwait->msg_type, pwait); - event_remove_timed(pwait->ev, pwait->te); DLIST_REMOVE(pwait->pvfs->wait_list, pwait); return 0; } @@ -145,6 +144,7 @@ static int pvfs_wait_destructor(void *ptr) te.handler = pvfs_wait_timeout; te.private = pwait; pwait->te = event_add_timed(pwait->ev, &te); + talloc_steal(pwait, pwait->te); /* register with the messaging subsystem for this message type */ |