- wlist_del ((struct ev_watcher_list **)&signals [w->signum - 1], (struct ev_watcher_list *)w);
- ev_stop ((struct ev_watcher *)w);
+ wlist_del ((WL *)&signals [w->signum - 1].head, (WL)w);
+ ev_stop ((W)w);
+
+ if (!signals [w->signum - 1].head)
+ signal (w->signum, SIG_DFL);
+}
+
+void evidle_start (struct ev_idle *w)
+{
+ if (ev_is_active (w))
+ return;
+
+ ev_start ((W)w, ++idlecnt);
+ array_needsize (idles, idlemax, idlecnt, );
+ idles [idlecnt - 1] = w;
+}
+
+void evidle_stop (struct ev_idle *w)
+{
+ idles [w->active - 1] = idles [--idlecnt];
+ ev_stop ((W)w);
+}
+
+void evcheck_start (struct ev_check *w)
+{
+ if (ev_is_active (w))
+ return;
+
+ ev_start ((W)w, ++checkcnt);
+ array_needsize (checks, checkmax, checkcnt, );
+ checks [checkcnt - 1] = w;
+}
+
+void evcheck_stop (struct ev_check *w)
+{
+ checks [w->active - 1] = checks [--checkcnt];
+ ev_stop ((W)w);