* exceptions.cc (_threadinfo::remove): Avoid a linked list walk.
This commit is contained in:
parent
73262d7a44
commit
ae2543ed76
|
@ -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>
|
2003-12-06 Christopher Faylor <cgf@redhat.com>
|
||||||
|
|
||||||
* cygtls.h (_threadinfo::find_tls): New function.
|
* cygtls.h (_threadinfo::find_tls): New function.
|
||||||
|
|
|
@ -188,17 +188,15 @@ _threadinfo::init_thread (void *)
|
||||||
void
|
void
|
||||||
_threadinfo::remove ()
|
_threadinfo::remove ()
|
||||||
{
|
{
|
||||||
_threadinfo *t;
|
|
||||||
EnterCriticalSection (&protect_linked_list);
|
EnterCriticalSection (&protect_linked_list);
|
||||||
for (t = _last_thread; t && t != this; t = t->prev)
|
if (prev)
|
||||||
continue;
|
|
||||||
if (t)
|
|
||||||
{
|
{
|
||||||
t->prev->next = t->next;
|
prev->next = next;
|
||||||
if (t->next)
|
if (next)
|
||||||
t->next->prev = t->prev;
|
next->prev = prev;
|
||||||
if (t == _last_thread)
|
if (this == _last_thread)
|
||||||
_last_thread = t->prev;
|
_last_thread = prev;
|
||||||
|
prev = next = NULL;
|
||||||
}
|
}
|
||||||
LeaveCriticalSection (&protect_linked_list);
|
LeaveCriticalSection (&protect_linked_list);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue