summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/exceptions.cc15
2 files changed, 14 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 69df166d4..8b5fef609 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,11 @@
2003-12-06 Christopher Faylor <cgf@redhat.com>
+ * exceptions.cc (_threadinfo::remove): Avoid returning without
+ unlocking critical section in the (hopefully impossible) case of an
+ unrecognized thread.
+
+2003-12-06 Christopher Faylor <cgf@redhat.com>
+
* cygtls.h: Add more "don't parse this" guards.
(_threadinfo::init_thread): Rename from 'init'.
(_threadinfo::init): Declare new function.
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index cb2db165f..aba96ecb0 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -192,13 +192,14 @@ _threadinfo::remove ()
EnterCriticalSection (&protect_linked_list);
for (t = _last_thread; t && t != this; t = t->prev)
continue;
- if (!t)
- return;
- t->prev->next = t->next;
- if (t->next)
- t->next->prev = t->prev;
- if (t == _last_thread)
- _last_thread = t->prev;
+ if (t)
+ {
+ t->prev->next = t->next;
+ if (t->next)
+ t->next->prev = t->prev;
+ if (t == _last_thread)
+ _last_thread = t->prev;
+ }
LeaveCriticalSection (&protect_linked_list);
}