summaryrefslogtreecommitdiff
path: root/ev.h
diff options
context:
space:
mode:
authorroot <root>2007-11-15 09:19:42 +0000
committerroot <root>2007-11-15 09:19:42 +0000
commit485804e1eaa0580124a1c94123822912811eaf88 (patch)
tree9849be789164624d019376fcf0f379b18bee88d9 /ev.h
parent7bd6739edfe911fb4f237dd8ac638581af3f3fa4 (diff)
optimise ev_default_loop
Diffstat (limited to 'ev.h')
-rw-r--r--ev.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/ev.h b/ev.h
index f2ec3f2..af6c2da 100644
--- a/ev.h
+++ b/ev.h
@@ -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);