1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Volker Lendecke
3254e39220 tevent: Add a poll backend 2011-02-28 16:40:20 +01:00
Bo Yang
8c8bb51de1 s3: signals are processed twice in child.
Signed-off-by: Bo Yang <boyang@samba.org>
2010-02-09 17:05:58 +08:00
Volker Lendecke
4d8118f145 tevent: Fix a comment 2009-11-26 17:22:56 +01:00
Rusty Russell
be4ac22784 lib/tevent: handle tevent_common_add_signal on different event contexts.
I don't know if this is a problem in real life.

The code assumes there's only one tevent_context; all signals will notify
the first event context.  That's counter-intuitive if you ever use more
than one, and there's nothing else in this code which prevents it AFAICT.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-08-28 14:09:09 +10:00
Stefan Metzmacher
45e4be0d96 tevent: add tevent_req_cancel() infrastructure
This offers a generic way for callers to cancel an
async request.

metze
2009-08-17 09:25:44 +02:00
Simo Sorce
30b2014a01 Expose functions need by backend writers
move publicly needed structures and functions in the public header.
Stop installing internal headers.
Update the signature and exports files with the new exposed
function.
2009-07-03 08:45:30 -04:00
Jelmer Vernooij
857c3f8322 tevent: Install tevent_internal.h in the standalone build.
This is not ideal, but at least it fixes the build of samba-gtk for now.
I've also added a warning about API guarantees at the top of the header.
2009-05-16 04:14:21 +02:00
Stefan Metzmacher
9eaf53d98e tevent: store the location where a request was finished
This is very useful to find bugs.
You can use 'p *req' in gdb to show where
tevent_req_done(), tevent_req_error() or tevent_req_nomem()
was called.

metze
2009-03-17 20:17:01 +01:00
Stefan Metzmacher
4bdf299385 tevent: use an immediate event fot tevent_req_post()
Now tevent_req_post() never fails

metze
2009-03-17 19:59:08 +01:00
Stefan Metzmacher
66886f8966 tevent: add support for immediate events
They're like directly triggered timed events,
but you can preallocated them and scheduling them
will not fail.

metze
2009-03-17 19:59:00 +01:00
Stefan Metzmacher
940e61846e tevent: add tevent_common_loop_wait() helper function and use it
tevent_loop_wait should do the same for all backends.
It should loop as long as we have pending events.

metze
2009-03-17 19:58:57 +01:00
Stefan Metzmacher
7142ef49bd tevent: add tevent_loop_set_nesting_hook()
This is an ugly hack to let the s4 server work arround
some bugs related to nested events and uid changing.

metze
2009-03-12 14:21:26 +01:00
Stefan Metzmacher
06f88fe7a2 tevent: don't allow nested tevent_loop_once() anymore
Incompatible caller should use tevent_loop_allow_nesting()
function.

metze
2009-03-12 12:14:18 +01:00
Stefan Metzmacher
9932fd2d9a tevent: pass __location__ to tevent_loop_once/wait()
metze
2009-03-12 12:12:34 +01:00
Stefan Metzmacher
09d1b2324c tevent: add tevent_req_received() function
This function can be called as last action of a _recv()
function, it destroys the data attached to the tevent_req.

metze
2009-03-10 16:44:44 +01:00
Simo Sorce
67d41d0fc7 Make struct tevent_req opaque
Move struct tevent_req in tevent_internal, and ad getters and setters
for private data and the callback function.
This patch also renames 'private_state' into 'data'. What is held in this
pointer is in fact data and not a state like enum tevent_req_state.
Calling it 'state' is confusing.

The functions addedd are:
tevent_req_set_callback() - sets req->async.fn and req->async.private_data
tevent_req_set_print_fn() - sets req->private_print
tevent_req_callback_data() - gets req->async.private_data
tevent_req_data() - gets rea->data

This way it is much simpler to keep API/ABI compatibility in the future.
2009-03-02 11:02:09 -05:00
Kai Blin
48b874e376 tevent: Rename ev_timeval* functions to tevent_timeval, export them.
Also add tevent_timeval_add() and tevent_timeval_current_ofs()
to help not depending on lub/util/time.c for things that just need tevent
2009-02-17 09:19:31 +01:00
Stefan Metzmacher
6211162d3e lib/tevent: change to LGPLv3+
metze
2009-02-16 08:53:25 +01:00
Stefan Metzmacher
113651c517 lib/tevent: add tevent_req infrastructure
This is almost a copy of the async_req code,
which will be removed later.

metze
2009-02-13 18:37:01 +01:00
Stefan Metzmacher
fa2461ae73 lib/tevent: expose ev_timeval_zero() for internal usage
metze
2009-02-13 16:02:14 +01:00
Stefan Metzmacher
1d949fe742 lib/tevent: remove broken tevent_aio support
It makes no sense to support aio events because,
the current implementation was based on IOCB_CMD_EPOLL_WAIT
which never made it into the main kernel tree.

The native linux aio can be used with select/epoll
using eventfd(), which means we can implement aio
with fd events and implement aio outside of tevent.

metze
2009-02-13 16:02:13 +01:00
Stefan Metzmacher
b09718fef2 tevent: add tevent_context destructor that unlinks the events from the context
metze
2009-01-05 22:44:54 +01:00
Stefan Metzmacher
ceac26008c tevent: keep a linked list of fd_events
metze
2009-01-05 22:44:53 +01:00
Stefan Metzmacher
b24924d6a6 tevent: keep a linked list of signal events
metze
2009-01-05 22:44:53 +01:00
Stefan Metzmacher
e45ed828d0 tevent: add tevent_fd_set_close_fn()
Let callers specify a close function
as an alternative to TEVENT_FD_AUTOCLOSE.

metze
2009-01-03 19:58:51 +01:00
Stefan Metzmacher
e928d863e2 tevent: move some common tevent_fd related functions into tevent_fd.c
metze
2009-01-03 19:58:50 +01:00
Stefan Metzmacher
4f04b06ac2 tevent: rename ev_debug_ops => tevent_debug_ops
And related changes, but we keep compat macros

metze
2009-01-02 18:16:53 +01:00
Stefan Metzmacher
227f799dee tevent: pass down handler_name and location to the backend layer
metze
2009-01-02 18:16:52 +01:00
Stefan Metzmacher
b12e78e645 tevent: use HAVE_EPOLL instead of HAVE_EVENTS_EPOLL
metze
2009-01-02 18:16:51 +01:00
Stefan Metzmacher
d9529a331a tevent: rename event_register_backend() => tevent_register_backend()
And fix the callers and there init functions.

metze
2009-01-02 18:16:51 +01:00
Stefan Metzmacher
183c379fe5 s4:lib/tevent: rename structs
list=""
list="$list event_context:tevent_context"
list="$list fd_event:tevent_fd"
list="$list timed_event:tevent_timer"

for s in $list; do
	o=`echo $s | cut -d ':' -f1`
	n=`echo $s | cut -d ':' -f2`
	r=`git grep "struct $o" |cut -d ':' -f1 |sort -u`
	files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4`
	for f in $files; do
		cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp
		mv $f.tmp $f
	done
done

metze
2008-12-29 20:46:40 +01:00
Stefan Metzmacher
7bf5768a52 lib/tevent: rename event_* => tevent_* in the header file
We have compat macros to keep the callers happy.

metze
2008-12-29 08:42:00 +01:00
Jelmer Vernooij
bd64688c6a Fix more compiler warnings in various places. 2008-12-23 22:57:11 +01:00
Stefan Metzmacher
504f8816e3 s4:lib/events: move to toplevel directory as lib/tevent/
This commit will not compile on its own.

metze
2008-12-17 13:31:28 +01:00