]> sourceware.org Git - newlib-cygwin.git/commitdiff
* exceptions.cc (_threadinfo::remove): Avoid a linked list walk.
authorChristopher Faylor <me@cgf.cx>
Sun, 7 Dec 2003 03:27:51 +0000 (03:27 +0000)
committerChristopher Faylor <me@cgf.cx>
Sun, 7 Dec 2003 03:27:51 +0000 (03:27 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/exceptions.cc

index 832b39f1eea8da52979d0bef3fe99603e73dfa2a..4da0b41670b9c955888fe8256fbb30b38e2e3c20 100644 (file)
@@ -1,3 +1,7 @@
+2003-12-06  Christopher Faylor  <cgf@redhat.com>
+
+       * exceptions.cc (_threadinfo::remove): Avoid a linked list walk.
+
 2003-12-06  Christopher Faylor  <cgf@redhat.com>
 
        * cygtls.h (_threadinfo::find_tls): New function.
index ea2c7e6d57100fceab6174c765fbea93c6aa0ee7..feb36327c4d7bb3b27a94a36f928fe7fe31a1136 100644 (file)
@@ -188,17 +188,15 @@ _threadinfo::init_thread (void *)
 void
 _threadinfo::remove ()
 {
-  _threadinfo *t;
   EnterCriticalSection (&protect_linked_list);
-  for (t = _last_thread; t && t != this; t = t->prev)
-    continue;
-  if (t)
+  if (prev)
     {
-      t->prev->next = t->next;
-      if (t->next)
-       t->next->prev = t->prev;
-      if (t == _last_thread)
-       _last_thread = t->prev;
+      prev->next = next;
+      if (next)
+       next->prev = prev;
+      if (this == _last_thread)
+       _last_thread = prev;
+      prev = next = NULL;
     }
   LeaveCriticalSection (&protect_linked_list);
 }
This page took 0.037779 seconds and 5 git commands to generate.