diff options
author | root <root> | 2007-11-15 09:19:42 +0000 |
---|---|---|
committer | root <root> | 2007-11-15 09:19:42 +0000 |
commit | 485804e1eaa0580124a1c94123822912811eaf88 (patch) | |
tree | 9849be789164624d019376fcf0f379b18bee88d9 /ev.h | |
parent | 7bd6739edfe911fb4f237dd8ac638581af3f3fa4 (diff) |
optimise ev_default_loop
Diffstat (limited to 'ev.h')
-rw-r--r-- | ev.h | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -269,7 +269,17 @@ void ev_set_syserr_cb (void (*cb)(const char *msg)); # if EV_MULTIPLICITY /* the default loop is the only one that handles signals and child watchers */ /* you can call this as often as you like */ -struct ev_loop *ev_default_loop (unsigned int flags); /* returns default loop */ +static struct ev_loop * +ev_default_loop (unsigned int flags) +{ + extern struct ev_loop *ev_default_loop_ptr; + extern struct ev_loop *ev_default_loop_ (unsigned int flags); + + if (!ev_default_loop_ptr) + ev_default_loop_ (flags); + + return ev_default_loop_ptr; +} /* create and destroy alternative loops that don't handle signals */ struct ev_loop *ev_loop_new (unsigned int flags); |