summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2009-07-08 02:46:05 +0000
committerroot <root>2009-07-08 02:46:05 +0000
commit0a4686f75f02682a280668644026bb886a73b4b0 (patch)
tree36756d79799b9d950e0b09c8f55a362651f586d9 /ev.c
parentab847d7a260f86a14c1f79508c0808bf11c4776c (diff)
*** empty log message ***
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/ev.c b/ev.c
index c5c3989..d6c28c7 100644
--- a/ev.c
+++ b/ev.c
@@ -1360,6 +1360,12 @@ ev_loop_count (EV_P)
return loop_count;
}
+unsigned int
+ev_loop_depth (EV_P)
+{
+ return loop_depth;
+}
+
void
ev_set_io_collect_interval (EV_P_ ev_tstamp interval)
{
@@ -2022,11 +2028,11 @@ time_update (EV_P_ ev_tstamp max_block)
}
}
-static int loop_done;
-
void
ev_loop (EV_P_ int flags)
{
+ ++loop_depth;
+
loop_done = EVUNLOOP_CANCEL;
call_pending (EV_A); /* in case we recurse, ensure ordering stays nice and clean */
@@ -2151,6 +2157,8 @@ ev_loop (EV_P_ int flags)
if (loop_done == EVUNLOOP_ONE)
loop_done = EVUNLOOP_CANCEL;
+
+ --loop_depth;
}
void