diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-01-05 09:35:49 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:36:50 -0500 |
commit | b213b70c089046f426e1e3f2f733e42a02e2cbfe (patch) | |
tree | a7f76bc62aa974810e691ad1715cc5900bba09ed /source4/lib/events/events_internal.h | |
parent | 9698b2c2821986fdf2bb66dc4a52b2d50fbea151 (diff) | |
download | samba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.tar.gz samba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.tar.bz2 samba-b213b70c089046f426e1e3f2f733e42a02e2cbfe.zip |
r20539: - split the common timer related events code into events_timed.c
- make it easier to plug in a new events backend
- add simpler 'select' and 'epoll' backends
This is part of the effort to add good AIO support. The events_aio.c
backend is done, but sometimes dies with a SEGV, which is why it isn't
enabled yet.
(This used to be commit 934f18283dbc7958944931a93a854526bcd54884)
Diffstat (limited to 'source4/lib/events/events_internal.h')
-rw-r--r-- | source4/lib/events/events_internal.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source4/lib/events/events_internal.h b/source4/lib/events/events_internal.h index de4e5f6a5a..dc321769e0 100644 --- a/source4/lib/events/events_internal.h +++ b/source4/lib/events/events_internal.h @@ -24,7 +24,7 @@ struct event_ops { /* conntext init */ - int (*context_init)(struct event_context *ev, void *private_data); + int (*context_init)(struct event_context *ev); /* fd_event functions */ struct fd_event *(*add_fd)(struct event_context *ev, @@ -41,6 +41,12 @@ struct event_ops { struct timeval next_event, event_timed_handler_t handler, void *private_data); + /* disk aio event functions */ + struct aio_event *(*add_aio)(struct event_context *ev, + TALLOC_CTX *mem_ctx, + struct iocb *iocb, + event_aio_handler_t handler, + void *private_data); /* loop functions */ int (*loop_once)(struct event_context *ev); @@ -71,11 +77,24 @@ struct timed_event { void *additional_data; }; +/* aio event is private to the aio backend */ +struct aio_event; + struct event_context { /* the specific events implementation */ const struct event_ops *ops; + + /* list of timed events - used by common code */ + struct timed_event *timed_events; + /* this is private for the events_ops implementation */ void *additional_data; }; -const struct event_ops *event_standard_get_ops(void); + +NTSTATUS event_register_backend(const char *name, const struct event_ops *ops); + +struct timed_event *common_event_add_timed(struct event_context *, TALLOC_CTX *, + struct timeval, event_timed_handler_t, void *); +void common_event_loop_timer(struct event_context *); +struct timeval common_event_loop_delay(struct event_context *); |