]> rtime.felk.cvut.cz Git - sojka/libev.git/commitdiff
*** empty log message ***
authorMarc Alexander Lehmann <libev@schmorp.de>
Sun, 6 May 2012 13:42:10 +0000 (13:42 +0000)
committerMarc Alexander Lehmann <libev@schmorp.de>
Sun, 6 May 2012 13:42:10 +0000 (13:42 +0000)
Changes
ev.c
ev.pod

diff --git a/Changes b/Changes
index 3698cded909eb5fa0b385c265f20c138f1995c37..f7047cd378901546d7244cb8b86f735c917bca06 100644 (file)
--- a/Changes
+++ b/Changes
@@ -5,7 +5,6 @@ TODO: EV_STANDALONE == NO_HASSEL (do not use clock_gettime in ev_standalone)
 
 TODO: document WSA_EV_USE_SOCKET in win32 part
 TODO: ^ OR use WSASend/WSARecv on the handle, which always works
-TODO: assert on fd watcher linked list pointing to itself
 TODO: faq, process a thing in each iteration
        - queueing pending watchers of higher priority from a watcher now invokes
           them in a timely fashion (reported by Denis Bilenko).
diff --git a/ev.c b/ev.c
index c1bd4a70bc3352d83530d994eb3049f91930a335..c2720a74dc96a3034d30179bab4e2e2dc8f2fb3b 100644 (file)
--- a/ev.c
+++ b/ev.c
@@ -2556,8 +2556,8 @@ void ecb_cold
 ev_verify (EV_P) EV_THROW
 {
 #if EV_VERIFY
-  int i;
-  WL w;
+  int i, j;
+  WL w, w2;
 
   assert (activecnt >= -1);
 
@@ -2566,10 +2566,15 @@ ev_verify (EV_P) EV_THROW
     assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0));
 
   assert (anfdmax >= 0);
-  for (i = 0; i < anfdmax; ++i)
-    for (w = anfds [i].head; w; w = w->next)
+  for (i = j = 0; i < anfdmax; ++i)
+    for (w = w2 = anfds [i].head; w; w = w->next)
       {
         verify_watcher (EV_A_ (W)w);
+
+        if (++j & 1)
+          w2 = w2->next;
+
+        assert (("libev: io watcher list contains a loop", w != w2));
         assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1));
         assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i));
       }
@@ -3252,6 +3257,9 @@ ev_io_start (EV_P_ ev_io *w) EV_THROW
   array_needsize (ANFD, anfds, anfdmax, fd + 1, array_init_zero);
   wlist_add (&anfds[fd].head, (WL)w);
 
+  /* common bug, apparently */
+  assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w));
+
   fd_change (EV_A_ fd, w->events & EV__IOFDSET | EV_ANFD_REIFY);
   w->events &= ~EV__IOFDSET;
 
diff --git a/ev.pod b/ev.pod
index ad893f4330b806e98b5c754ecadce84c61a5d662..784a2fa66d794519c41b3800100af22976fb1f75 100644 (file)
--- a/ev.pod
+++ b/ev.pod
@@ -4240,6 +4240,14 @@ Brian Maher has written a partial interface to libev for lua (at the
 time of this writing, only C<ev_io> and C<ev_timer>), to be found at
 L<http://github.com/brimworks/lua-ev>.
 
+=item Javascript
+
+Node.js (L<http://nodejs.org>) uses libev as the underlying event library.
+
+=item Others
+
+There are others, and I stopped counting.
+
 =back