summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2010-10-22 06:02:27 +0000
committerroot <root>2010-10-22 06:02:27 +0000
commitdd0500884c780a5103d959f64b72fb81e566ddd6 (patch)
tree3edd4ea5f7bf00a37279e098f917a0819b154932
parentb5335f1d75c19c2618d6f9cc53ab530e1ed45b28 (diff)
*** empty log message ***
-rw-r--r--Changes6
-rw-r--r--ev.h34
-rw-r--r--ev.pod25
3 files changed, 36 insertions, 29 deletions
diff --git a/Changes b/Changes
index 1450f86..81cae25 100644
--- a/Changes
+++ b/Changes
@@ -44,8 +44,10 @@ TODO: include ev_xyz_start in each example?
- define _DARWIN_UNLIMITED_SELECT. just so.
- use enum instead of #define for most constants.
- improve compatibility to older C++ compilers.
- - ev_run/ev_default_loop/ev_break/ev_loop_new have now default
- arguments when compiled as C++.
+ - (experimental) ev_run/ev_default_loop/ev_break/ev_loop_new have now
+ default arguments when compiled as C++.
+ - (experimental) all ev_functions that accept only a loop argument
+ default that to EV_DEFAULT_UC when compiled as C++.
3.9 Thu Dec 31 07:59:59 CET 2009
- signalfd is no longer used by default and has to be requested
diff --git a/ev.h b/ev.h
index 941190e..b2157eb 100644
--- a/ev.h
+++ b/ev.h
@@ -164,6 +164,7 @@ struct ev_loop;
# define EV_DEFAULT_UC_ EV_DEFAULT_UC,
# define EV_DEFAULT ev_default_loop (0)
# define EV_DEFAULT_ EV_DEFAULT,
+# define EV_PDEF EV_P EV_DEFARG (EV_DEFAULT_UC)
#else
# define EV_P void
# define EV_P_
@@ -173,6 +174,7 @@ struct ev_loop;
# define EV_DEFAULT_
# define EV_DEFAULT_UC
# define EV_DEFAULT_UC_
+# define EV_PDEF EV_P
# undef EV_EMBED_ENABLE
#endif
@@ -537,10 +539,10 @@ ev_default_loop (unsigned int flags EV_DEFARG (0))
/* create and destroy alternative loops that don't handle signals */
struct ev_loop *ev_loop_new (unsigned int flags EV_DEFARG (0));
-void ev_loop_destroy (EV_P);
-void ev_loop_fork (EV_P);
+void ev_loop_destroy (EV_PDEF);
+void ev_loop_fork (EV_PDEF);
-ev_tstamp ev_now (EV_P); /* time w.r.t. timers and the eventloop, updated after each poll */
+ev_tstamp ev_now (EV_PDEF); /* time w.r.t. timers and the eventloop, updated after each poll */
#else
@@ -556,7 +558,7 @@ ev_now (void)
#endif /* multiplicity */
EV_INLINE int
-ev_is_default_loop (EV_P)
+ev_is_default_loop (EV_PDEF)
{
#if EV_MULTIPLICITY
extern struct ev_loop *ev_default_loop_ptr;
@@ -574,9 +576,9 @@ void ev_default_destroy (void); /* destroy the default loop */
/* you can actually call it at any time, anywhere :) */
void ev_default_fork (void);
-unsigned int ev_backend (EV_P); /* backend in use by loop */
+unsigned int ev_backend (EV_PDEF); /* backend in use by loop */
-void ev_now_update (EV_P); /* update event loop time */
+void ev_now_update (EV_PDEF); /* update event loop time */
#if EV_WALK_ENABLE
/* walk (almost) all watchers in the loop of a given type, invoking the */
@@ -609,8 +611,8 @@ void ev_break (EV_P_ int how EV_DEFARG (EVBREAK_ONE)); /* break out of the loop
* keeps one reference. if you have a long-running watcher you never unregister that
* should not keep ev_loop from running, unref() after starting, and ref() before stopping.
*/
-void ev_ref (EV_P);
-void ev_unref (EV_P);
+void ev_ref (EV_PDEF);
+void ev_unref (EV_PDEF);
/*
* convenience function, wait for a single event, without registering an event watcher
@@ -619,27 +621,27 @@ void ev_unref (EV_P);
void ev_once (EV_P_ int fd, int events, ev_tstamp timeout, void (*cb)(int revents, void *arg), void *arg);
# if EV_FEATURE_API
-unsigned int ev_iteration (EV_P); /* number of loop iterations */
-unsigned int ev_depth (EV_P); /* #ev_loop enters - #ev_loop leaves */
-void ev_verify (EV_P); /* abort if loop data corrupted */
+unsigned int ev_iteration (EV_PDEF); /* number of loop iterations */
+unsigned int ev_depth (EV_PDEF); /* #ev_loop enters - #ev_loop leaves */
+void ev_verify (EV_PDEF); /* abort if loop data corrupted */
void ev_set_io_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
void ev_set_timeout_collect_interval (EV_P_ ev_tstamp interval); /* sleep at least this time, default 0 */
/* advanced stuff for threading etc. support, see docs */
void ev_set_userdata (EV_P_ void *data);
-void *ev_userdata (EV_P);
+void *ev_userdata (EV_PDEF);
void ev_set_invoke_pending_cb (EV_P_ void (*invoke_pending_cb)(EV_P));
void ev_set_loop_release_cb (EV_P_ void (*release)(EV_P), void (*acquire)(EV_P));
-unsigned int ev_pending_count (EV_P); /* number of pending events, if any */
-void ev_invoke_pending (EV_P); /* invoke all pending watchers */
+unsigned int ev_pending_count (EV_PDEF); /* number of pending events, if any */
+void ev_invoke_pending (EV_PDEF); /* invoke all pending watchers */
/*
* stop/start the timer handling.
*/
-void ev_suspend (EV_P);
-void ev_resume (EV_P);
+void ev_suspend (EV_PDEF);
+void ev_resume (EV_PDEF);
#endif
#endif
diff --git a/ev.pod b/ev.pod
index 118d29c..5dc63ff 100644
--- a/ev.pod
+++ b/ev.pod
@@ -4533,9 +4533,10 @@ OpenGL drivers.
The kqueue syscall is broken in all known versions - most versions support
only sockets, many support pipes.
-Libev tries to work around this by not using C<kqueue> by default on
-this rotten platform, but of course you can still ask for it when creating
-a loop.
+Libev tries to work around this by not using C<kqueue> by default on this
+rotten platform, but of course you can still ask for it when creating a
+loop - embedding a socket-only kqueue loop into a select-based one is
+probably going to work well.
=head3 C<poll> is buggy
@@ -4564,19 +4565,21 @@ work on OS/X.
The default compile environment on Solaris is unfortunately so
thread-unsafe that you can't even use components/libraries compiled
-without C<-D_REENTRANT> (as long as they use C<errno>), which, of course,
-isn't defined by default.
+without C<-D_REENTRANT> in a threaded program, which, of course, isn't
+defined by default. A valid, if stupid, implementation choice.
If you want to use libev in threaded environments you have to make sure
it's compiled with C<_REENTRANT> defined.
=head3 Event port backend
-The scalable event interface for Solaris is called "event ports". Unfortunately,
-this mechanism is very buggy. If you run into high CPU usage, your program
-freezes or you get a large number of spurious wakeups, make sure you have
-all the relevant and latest kernel patches applied. No, I don't know which
-ones, but there are multiple ones.
+The scalable event interface for Solaris is called "event
+ports". Unfortunately, this mechanism is very buggy in all major
+releases. If you run into high CPU usage, your program freezes or you get
+a large number of spurious wakeups, make sure you have all the relevant
+and latest kernel patches applied. No, I don't know which ones, but there
+are multiple ones to apply, and afterwards, event ports actually work
+great.
If you can't get it to work, you can try running the program by setting
the environment variable C<LIBEV_FLAGS=3> to only allow C<poll> and
@@ -4587,7 +4590,7 @@ C<select> backends.
AIX unfortunately has a broken C<poll.h> header. Libev works around
this by trying to avoid the poll backend altogether (i.e. it's not even
compiled in), which normally isn't a big problem as C<select> works fine
-with large bitsets, and AIX is dead anyway.
+with large bitsets on AIX, and AIX is dead anyway.
=head2 WIN32 PLATFORM LIMITATIONS AND WORKAROUNDS