From c4bba4548e38ec99cc93fcdb2dd753dc8f54c9d8 Mon Sep 17 00:00:00 2001 From: Marc Alexander Lehmann Date: Fri, 27 Dec 2013 06:01:21 +0000 Subject: [PATCH] *** empty log message *** --- Changes | 3 +++ ev.3 | 8 ++++---- ev.c | 4 ++-- ev.h | 8 +++++--- ev_vars.h | 6 +++--- 5 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Changes b/Changes index 474a088..df3d796 100644 --- a/Changes +++ b/Changes @@ -12,6 +12,7 @@ TODO: document file descriptor usage per loop TODO: store loop pid_t and compare isndie signal handler,store 1 for same, 2 for differign pid, clean up in loop_fork TODO: embed watchers need updating when fd changes TODO: document portbaility requirements for atomic pointer access +TODO: possible cb aliasing? - mark event pipe fd as cloexec after a fork (analyzed by Sami Farin). - (ecb) support m68k, m88k and sh (patch by Miod Vallat). @@ -20,6 +21,8 @@ TODO: document portbaility requirements for atomic pointer access - in the absence of autoconf, do not use the clock syscall on glibc >= 2.17 (avoids the syscall AND -lrt on systems doing clock_gettime in userspace). + - ensure extern "C" function pointers are used for externally-visible + loop callbacks (not watcher callbacks yet). 4.15 Fri Mar 1 12:04:50 CET 2013 - destroying a non-default loop would stop the global waitpid diff --git a/ev.3 b/ev.3 index 18145ef..c254fc6 100644 --- a/ev.3 +++ b/ev.3 @@ -133,7 +133,7 @@ .\" ======================================================================== .\" .IX Title "LIBEV 3" -.TH LIBEV 3 "2013-10-29" "libev-4.15" "libev - high performance full featured event loop" +.TH LIBEV 3 "2013-12-27" "libev-4.15" "libev - high performance full featured event loop" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l @@ -2555,9 +2555,9 @@ default loop and for \f(CW\*(C`SIGIO\*(C'\fR in another loop, but you cannot wat \&\f(CW\*(C`SIGINT\*(C'\fR in both the default loop and another loop at the same time. At the moment, \f(CW\*(C`SIGCHLD\*(C'\fR is permanently tied to the default loop. .PP -When the first watcher gets started will libev actually register something -with the kernel (thus it coexists with your own signal handlers as long as -you don't register any with libev for the same signal). +Only after the first watcher for a signal is started will libev actually +register something with the kernel. It thus coexists with your own signal +handlers as long as you don't register any with libev for the same signal. .PP If possible and supported, libev will install its handlers with \&\f(CW\*(C`SA_RESTART\*(C'\fR (or equivalent) behaviour enabled, so system calls should diff --git a/ev.c b/ev.c index c8e7fb2..c719b2f 100644 --- a/ev.c +++ b/ev.c @@ -2547,13 +2547,13 @@ ev_userdata (EV_P) EV_THROW } void -ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW +ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_THROW { invoke_cb = invoke_pending_cb; } void -ev_set_loop_release_cb (EV_P_ void (*release)(EV_P) EV_THROW, void (*acquire)(EV_P) EV_THROW) EV_THROW +ev_set_loop_release_cb (EV_P_ ev_loop_callback_nothrow release, ev_loop_callback_nothrow acquire) EV_THROW { release_cb = release; acquire_cb = acquire; diff --git a/ev.h b/ev.h index c5d582e..38a507e 100644 --- a/ev.h +++ b/ev.h @@ -658,8 +658,10 @@ EV_API_DECL void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval) EV_T /* advanced stuff for threading etc. support, see docs */ EV_API_DECL void ev_set_userdata (EV_P_ void *data) EV_THROW; EV_API_DECL void *ev_userdata (EV_P) EV_THROW; -EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P)) EV_THROW; -EV_API_DECL void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P) EV_THROW) EV_THROW; +typedef void (*ev_loop_callback)(EV_P); +EV_API_DECL void ev_set_invoke_pending_cb (EV_P_ ev_loop_callback invoke_pending_cb) EV_THROW; +typedef void (*ev_loop_callback_nothrow)(EV_P) EV_THROW; +EV_API_DECL void ev_set_loop_release_cb (EV_P_ ev_loop_callback_nothrow release, ev_loop_callback_nothrow acquire) EV_THROW; EV_API_DECL unsigned int ev_pending_count (EV_P) EV_THROW; /* number of pending events, if any */ EV_API_DECL void ev_invoke_pending (EV_P); /* invoke all pending watchers */ @@ -730,7 +732,7 @@ EV_API_DECL void ev_resume (EV_P) EV_THROW; #endif /* stopping (enabling, adding) a watcher does nothing if it is already running */ -/* stopping (disabling, deleting) a watcher does nothing unless its already running */ +/* stopping (disabling, deleting) a watcher does nothing unless it's already running */ #if EV_PROTOTYPES /* feeds an event into a watcher as if the event actually occurred */ diff --git a/ev_vars.h b/ev_vars.h index 5fd9c7a..f438d82 100644 --- a/ev_vars.h +++ b/ev_vars.h @@ -194,9 +194,9 @@ VARx(unsigned int, loop_count) /* total number of loop iterations/blocks */ VARx(unsigned int, loop_depth) /* #ev_run enters - #ev_run leaves */ VARx(void *, userdata) -VAR (release_cb, void (*release_cb)(EV_P) EV_THROW) -VAR (acquire_cb, void (*acquire_cb)(EV_P) EV_THROW) -VAR (invoke_cb , void (*invoke_cb) (EV_P)) +VAR (release_cb, ev_loop_callback_nothrow release_cb) +VAR (acquire_cb, ev_loop_callback_nothrow acquire_cb) +VAR (invoke_cb , ev_loop_callback invoke_cb) #endif #undef VARx