summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent_select.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-03-16 12:34:23 +0100
committerStefan Metzmacher <metze@samba.org>2009-03-17 19:58:55 +0100
commit3af7db3dce0e5529114f6969e9905c6d4c65dfe8 (patch)
treea11a2a743fda6408044725ae1ef45c5643774dc3 /lib/tevent/tevent_select.c
parent77d2cd1ff7dab3a7a76449bfb3fe1d6e80df292b (diff)
downloadsamba-3af7db3dce0e5529114f6969e9905c6d4c65dfe8.tar.gz
samba-3af7db3dce0e5529114f6969e9905c6d4c65dfe8.tar.bz2
samba-3af7db3dce0e5529114f6969e9905c6d4c65dfe8.zip
tevent: let tevent_loop_once() just run one fd event
This makes the logic much simpler for the callers, and matches the samba3 behavior. If needed we can add performance tunning for tevent_loop_wait() later. metze
Diffstat (limited to 'lib/tevent/tevent_select.c')
-rw-r--r--lib/tevent/tevent_select.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/tevent/tevent_select.c b/lib/tevent/tevent_select.c
index cdddb601c4..bbbb95fce8 100644
--- a/lib/tevent/tevent_select.c
+++ b/lib/tevent/tevent_select.c
@@ -38,10 +38,6 @@ struct select_event_context {
/* information for exiting from the event loop */
int exit_code;
-
- /* this is incremented when the loop over events causes something which
- could change the events yet to be processed */
- uint32_t destruction_count;
};
/*
@@ -95,8 +91,6 @@ static int select_event_fd_destructor(struct tevent_fd *fde)
if (select_ev->maxfd == fde->fd) {
select_ev->maxfd = EVENT_INVALID_MAXFD;
}
-
- select_ev->destruction_count++;
}
return tevent_common_fd_destructor(fde);
@@ -138,7 +132,6 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
fd_set r_fds, w_fds;
struct tevent_fd *fde;
int selrtn;
- uint32_t destruction_count = ++select_ev->destruction_count;
/* we maybe need to recalculate the maxfd */
if (select_ev->maxfd == EVENT_INVALID_MAXFD) {
@@ -200,15 +193,13 @@ static int select_event_loop_select(struct select_event_context *select_ev, stru
if (FD_ISSET(fde->fd, &w_fds)) flags |= TEVENT_FD_WRITE;
if (flags) {
fde->handler(select_ev->ev, fde, flags, fde->private_data);
- if (destruction_count != select_ev->destruction_count) {
- break;
- }
+ break;
}
}
}
return 0;
-}
+}
/*
do a single event loop using the events defined in ev