diff options
| author | Mike Makonnen <mtm@FreeBSD.org> | 2004-06-27 09:53:06 +0000 |
|---|---|---|
| committer | Mike Makonnen <mtm@FreeBSD.org> | 2004-06-27 09:53:06 +0000 |
| commit | 356c2d4f58037f0bb9a1834ebf3589475b9ff635 (patch) | |
| tree | b3b09f6ee52944df716fed46a813bf568c4926b1 /lib/libthr/thread/thr_init.c | |
| parent | 0a44517d3a4783c98e9aa5b4a1f79f8123978adb (diff) | |
Notes
Diffstat (limited to 'lib/libthr/thread/thr_init.c')
| -rw-r--r-- | lib/libthr/thread/thr_init.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_init.c b/lib/libthr/thread/thr_init.c index 98c355a710c1..cf1eb6bdfc42 100644 --- a/lib/libthr/thread/thr_init.c +++ b/lib/libthr/thread/thr_init.c @@ -205,7 +205,7 @@ init_tdlist(struct pthread *td, int reinit) */ if (reinit) { TAILQ_FOREACH_SAFE(tdTemp, &_thread_list, tle, tdTemp2) { - if (tdTemp != NULL) { + if (tdTemp != NULL && tdTemp != td) { TAILQ_REMOVE(&_thread_list, tdTemp, tle); free(tdTemp); } @@ -220,10 +220,10 @@ init_tdlist(struct pthread *td, int reinit) } else { TAILQ_INIT(&_thread_list); TAILQ_INIT(&_dead_list); - } - /* Insert this thread as the first thread in the active list */ - TAILQ_INSERT_HEAD(&_thread_list, td, tle); + /* Insert this thread as the first thread in the active list */ + TAILQ_INSERT_HEAD(&_thread_list, td, tle); + } /* * Initialize the active thread list lock and the |
