summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2008-09-29 03:31:14 +0000
committerroot <root>2008-09-29 03:31:14 +0000
commit2736c2b0a7a4e6fbb8fdb117eef4cef1a2261eb1 (patch)
tree3c53e7ec2655dd5652f9e3a55607da9da0885067 /ev.c
parent96ee63afe7f6aa865a8cfd2ac761e81a9a051b52 (diff)
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/ev.c b/ev.c
index bc8b8d4..b20112e 100644
--- a/ev.c
+++ b/ev.c
@@ -2835,6 +2835,18 @@ embed_prepare_cb (EV_P_ ev_prepare *prepare, int revents)
}
}
+static void
+embed_fork_cb (EV_P_ ev_fork *fork_w, int revents)
+{
+ ev_embed *w = (ev_embed *)(((char *)fork_w) - offsetof (ev_embed, fork));
+
+ {
+ struct ev_loop *loop = w->other;
+
+ ev_loop_fork (EV_A);
+ }
+}
+
#if 0
static void
embed_idle_cb (EV_P_ ev_idle *idle, int revents)
@@ -2864,6 +2876,9 @@ ev_embed_start (EV_P_ ev_embed *w)
ev_set_priority (&w->prepare, EV_MINPRI);
ev_prepare_start (EV_A_ &w->prepare);
+ ev_fork_init (&w->fork, embed_fork_cb);
+ ev_fork_start (EV_A_ &w->fork);
+
/*ev_idle_init (&w->idle, e,bed_idle_cb);*/
ev_start (EV_A_ (W)w, 1);
@@ -2880,10 +2895,9 @@ ev_embed_stop (EV_P_ ev_embed *w)
EV_FREQUENT_CHECK;
- ev_io_stop (EV_A_ &w->io);
+ ev_io_stop (EV_A_ &w->io);
ev_prepare_stop (EV_A_ &w->prepare);
-
- ev_stop (EV_A_ (W)w);
+ ev_fork_stop (EV_A_ &w->fork);
EV_FREQUENT_CHECK;
}