Martin Schwenke
796acbd9ff
lib/tevent: Add trace point callback
...
Set/get a single callback function to be invoked at various trace
points. Define "before wait" and "after wait" trace points - more
trace points can be added later if required.
CTDB wants this to log long waits and events.
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-08 19:00:05 +02:00
Sumit Bose
158b208dfd
tevent: Set FD_CLOEXEC on epoll handle
...
If an application using libtevent starts a new process the epoll file descriptor
is leaked to the new process if the event context is not freed explicitly. By
setting FD_CLOEXEC this is not needed anymore.
Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-11 14:38:53 -04:00
Volker Lendecke
7720facd42
tevent: Fix a comment
...
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Thu Feb 17 18:16:18 CET 2011 on sn-devel-104
2011-02-17 18:16:18 +01:00
Andrew Tridgell
2550bbc981
tevent: mark backend init fns as _PRIVATE_
...
these are not supposed to be exposed in the library
2010-04-18 15:00:38 +10: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
0139befb91
tevent: check signal events first in event_loop_once
...
We also check for signal events directly before and after
the select/epoll calls.
metze
2009-03-17 19:58:56 +01:00
Stefan Metzmacher
3af7db3dce
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
2009-03-17 19:58:55 +01:00
Stefan Metzmacher
9932fd2d9a
tevent: pass __location__ to tevent_loop_once/wait()
...
metze
2009-03-12 12:12:34 +01: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
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
e058e51d63
tevent: completely initialize tevent_fd structs
...
This fixes crash bugs... I forgot to commit and squash
this to commit e45ed828d0
metze
2009-01-04 09:39:17 +01:00
Stefan Metzmacher
67810019a0
tevent: remove TEVENT_FD_AUTOCLOSE feature
...
TEVENT_FD_AUTOCLOSE adds a dependency to SOCKET_WRAPPER,
which is bad. Callers should use tevent_fd_set_close_fn() now.
metze
2009-01-03 19:58:54 +01:00
Stefan Metzmacher
2c8a10fe88
tevent: remove dependency to SOCKET_WRAPPER via "system/network.h"
...
metze
2009-01-03 19:58:54 +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
784b2dc8d0
tevent: use TEVENT_FD_* instead of EVENT_FD_*
...
metze
2009-01-02 18:16:53 +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
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
0ffed7d992
tevent: use libreplace headers instead of system headers
...
metze
2009-01-02 18:16:49 +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
Stefan Metzmacher
46eda79090
s4:lib/tevent: add lib/events/ compat and let things compile
...
metze
2008-12-17 13:31:29 +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