From: root Date: Wed, 31 Oct 2007 16:29:52 +0000 (+0000) Subject: make libev safer w.r.t. reentrancy X-Git-Tag: rel-0_5~82 X-Git-Url: https://git.llucax.com/software/libev.git/commitdiff_plain/caa1fd0cc89d111a00f323bb6eff46f57311aed5?ds=inline make libev safer w.r.t. reentrancy --- diff --git a/ev.c b/ev.c index f580a88..246b38f 100644 --- a/ev.c +++ b/ev.c @@ -418,11 +418,9 @@ fd_reify (void) static void call_pending () { - int i; - - for (i = 0; i < pendingcnt; ++i) + while (pendingcnt) { - ANPENDING *p = pendings + i; + ANPENDING *p = pendings + --pendingcnt; if (p->w) { @@ -430,8 +428,6 @@ call_pending () p->w->cb (p->w, p->events); } } - - pendingcnt = 0; } static void