summaryrefslogtreecommitdiff
path: root/lib/tevent/tevent.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-01tevent: optimize adding new zero timer eventsStefan Metzmacher1-0/+1
Such events were used before we had immediate events. It's likely that there're a lot of this events and we need to add new ones in fifo order. The tricky part is that tevent_common_add_timer() should not use the optimization as it's used by broken Samba versions, which don't use tevent_common_loop_timer_delay() in source3/lib/events.c. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01tevent: add trace points BEFORE_LOOP_ONCE and AFTER_LOOP_ONCEMichael Adam1-0/+4
The define TEVENT_HAS_LOOP_ONCE_TRACE_POINTS can be used to detect the new feature, without writing configure tests. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-03-01tevent: fix compiler warning in tevent_context_init_byname()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-02-14tevent: make use of tevent_find_ops_byname() in tevent_context_init_byname()Stefan Metzmacher1-14/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: make sure tevent_backend_init() only runs onceStefan Metzmacher1-0/+8
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Add a utility function tevent_find_ops_byname().Jeremy Allison1-0/+22
Returns an event ops struct given a string name. Not yet used, but will be part of the new "standard" fallback code. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-02-14tevent: Preparing to fix "standard" backend fallback. Initialize standard ↵Jeremy Allison1-1/+1
after epoll. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2012-08-16lib/tevent: Add a thread-safe tevent backendVolker Lendecke1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-06-08tevent: expose tevent_context_init_opsStefan Metzmacher1-3/+5
This can be used to implement wrapper backends, while passing a private pointer to the backens init function via ev->additional_data. metze
2011-12-09tevent: tevent_schedule_immediate never failsVolker Lendecke1-1/+0
Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Dec 9 16:47:23 CET 2011 on sn-devel-104
2011-08-12tevent: don't force the nesting flag to false in the destructorAndrew Tridgell1-3/+7
the tevent destructor is called in tevent_re_initialise(), to reset the event context back to its original state for creating child processes. We need the nesting flag to stay the same Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Fri Aug 12 05:18:25 CEST 2011 on sn-devel-104
2011-08-10tevent: cleanup nesting counter when doing a full reinit.Simo Sorce1-0/+7
We may be forking from within a loop, so we need to clean-up to avoid aborts when nesting is not allowed and we are in a new children. Signed-off-by: Andreas Schneider <asn@samba.org>
2011-02-28tevent: Add a poll backendVolker Lendecke1-0/+1
2010-10-08tevent: Do not use talloc_autofree_contextVolker Lendecke1-3/+2
2010-05-05tevent: Remove erroneous comments about TEVENT_FD_AUTOCLOSEStephen Gallagher1-3/+0
There is no such flag.
2010-03-26tevent: added tevent_re_initialise()Andrew Tridgell1-0/+15
This allows us to re-initialise a tevent context without destroying the pointer. That means that if someone keeps a long term ptr to the event context across a fork it will still work. This also brings the memory handling in single and standard process models much closer together, which means less bugs that we don't find with make test.
2010-02-09s3: signals are processed twice in child.Bo Yang1-0/+7
Signed-off-by: Bo Yang <boyang@samba.org>
2009-08-28lib/tevent: close pipe_fds on event_context destructionRusty Russell1-0/+2
The "hack_fds" were never closed before; now they're inside event_context they should be closed when that is destroyed. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2009-03-19tevent: fix the nesting logicStefan Metzmacher1-7/+7
Only tevent_loop_once and tevent_loop_until() should care about the nesting level. This fixes the samba3 printing code where we use tevent_loop_wait() and don't allow nested events. We still call the nesting hook for all levels, we need to decide if we really want this... metze
2009-03-19fixed a logic bug in the tevent nesting codeAndrew Tridgell1-1/+13
The event nesting code never triggered as nesting.level was never greater than 1. The main event loop needs to increase the nesting level by 1. I also added a paranoia check to the nesting setup call. The API as currently written cannot support multiple nesting hooks, so we need to abort if multiple hooks are tried.
2009-03-17tevent: add support for immediate eventsStefan Metzmacher1-0/+49
They're like directly triggered timed events, but you can preallocated them and scheduling them will not fail. metze
2009-03-17tevent: add tevent_common_loop_wait() helper function and use itStefan Metzmacher1-0/+28
tevent_loop_wait should do the same for all backends. It should loop as long as we have pending events. metze
2009-03-12tevent: Fix might be unitialized warningTim Prouty1-1/+1
2009-03-12tevent: add tevent_loop_until()Stefan Metzmacher1-0/+62
This is only a hack for samba4 and should not be used in new code. metze
2009-03-12tevent: add tevent_loop_set_nesting_hook()Stefan Metzmacher1-1/+39
This is an ugly hack to let the s4 server work arround some bugs related to nested events and uid changing. metze
2009-03-12tevent: don't allow nested tevent_loop_once() anymoreStefan Metzmacher1-1/+36
Incompatible caller should use tevent_loop_allow_nesting() function. metze
2009-03-12tevent: pass __location__ to tevent_loop_once/wait()Stefan Metzmacher1-4/+4
metze
2009-03-12tevent: add tevent_set_abort_fn()Stefan Metzmacher1-0/+19
metze
2009-03-12tevent: add tevent_signal_support()Stefan Metzmacher1-0/+8
Not every tevent backend supports signal events. metze
2009-02-16lib/tevent: change to LGPLv3+Stefan Metzmacher1-12/+17
metze
2009-02-13lib/tevent: remove broken tevent_aio supportStefan Metzmacher1-19/+0
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-01-12tevent: use for() loops instead of while() loopsStefan Metzmacher1-12/+9
metze
2009-01-11tevent: Fix build breakTim Prouty1-1/+1
2009-01-11Fix tevent_common_context_destructor to remove all events instead of just ↵Bo Yang1-4/+10
the first one Signed-off-by: Bo Yang <boyang@novell.com> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2009-01-07tevent: don't try to dereference fde->event_ctx when the event context ↵Stefan Metzmacher1-0/+3
doesn't exists anymore metze
2009-01-05tevent: add tevent_context destructor that unlinks the events from the contextStefan Metzmacher1-0/+31
metze
2009-01-03tevent: add tevent_fd_set_auto_close()Stefan Metzmacher1-0/+14
tevent_fd_set_auto_close() is a simple wrapper arround tevent_fd_set_close_fn() with a callback that uses plain close(2). metze
2009-01-03tevent: add tevent_fd_set_close_fn()Stefan Metzmacher1-0/+10
Let callers specify a close function as an alternative to TEVENT_FD_AUTOCLOSE. metze
2009-01-02tevent: pass down handler_name and location to the backend layerStefan Metzmacher1-4/+8
metze
2009-01-02tevent: make tevent_add_*() macros arround _tevent_add_*()Stefan Metzmacher1-20/+33
This passes some additional debug information into the events system to make it easier to find bugs. metze
2009-01-02tevent: use HAVE_EPOLL instead of HAVE_EVENTS_EPOLLStefan Metzmacher1-2/+2
metze
2009-01-02tevent: rename event_register_backend() => tevent_register_backend()Stefan Metzmacher1-5/+5
And fix the callers and there init functions. metze
2009-01-02tevent: rename event_context_init* => tevent_context_init*()Stefan Metzmacher1-25/+26
metze
2009-01-02tevent: rename event_[s|g]et_fd_flags => tevent_fd_[s|g]et_flagsStefan Metzmacher1-2/+2
metze
2009-01-02tevent: rename event_loop_* => tevent_loop_*Stefan Metzmacher1-4/+4
metze
2009-01-02tevent: rename event_set_default_backend() => tevent_set_default_backend()Stefan Metzmacher1-5/+6
metze
2009-01-02s4:tevent: move event_context_find() to tevent_s4.cStefan Metzmacher1-18/+0
metze
2008-12-29s4:lib/tevent: rename structsStefan Metzmacher1-16/+16
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-29lib/tevent: rename event_* => tevent_* in the header fileStefan Metzmacher1-1/+1
We have compat macros to keep the callers happy. metze
2008-12-17s4:lib/tevent: add lib/events/ compat and let things compileStefan Metzmacher1-3/+3
metze