From caa1fd0cc89d111a00f323bb6eff46f57311aed5 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 31 Oct 2007 16:29:52 +0000 Subject: [PATCH] make libev safer w.r.t. reentrancy --- ev.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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 -- 2.43.0