diff options
author | deischen <deischen@FreeBSD.org> | 2003-06-08 17:35:11 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2003-06-08 17:35:11 +0000 |
commit | 08f5ae21798662f49079405699e6a7a9257175b4 (patch) | |
tree | e2f59ae805fe33406bc26075d32f8eea7414ed07 /lib | |
parent | 49fd6082dc00a29d428e37d6172c9c7e7ec381af (diff) | |
download | FreeBSD-src-08f5ae21798662f49079405699e6a7a9257175b4.zip FreeBSD-src-08f5ae21798662f49079405699e6a7a9257175b4.tar.gz |
Insert threads at the end of the free thread list so that
the chance of getting the same thread id when allocating a
new thread is reduced. This won't work if the application
creates a new thread for every time a thread exits, but
we're still within the allowances of POSIX.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkse/thread/thr_kern.c | 2 | ||||
-rw-r--r-- | lib/libpthread/thread/thr_kern.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index 365d799..71957cf 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -2151,7 +2151,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread) else { crit = _kse_critical_enter(); KSE_LOCK_ACQUIRE(curthread->kse, &thread_lock); - TAILQ_INSERT_HEAD(&free_threadq, thread, tle); + TAILQ_INSERT_TAIL(&free_threadq, thread, tle); free_thread_count++; KSE_LOCK_RELEASE(curthread->kse, &thread_lock); _kse_critical_leave(crit); diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index 365d799..71957cf 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -2151,7 +2151,7 @@ _thr_free(struct pthread *curthread, struct pthread *thread) else { crit = _kse_critical_enter(); KSE_LOCK_ACQUIRE(curthread->kse, &thread_lock); - TAILQ_INSERT_HEAD(&free_threadq, thread, tle); + TAILQ_INSERT_TAIL(&free_threadq, thread, tle); free_thread_count++; KSE_LOCK_RELEASE(curthread->kse, &thread_lock); _kse_critical_leave(crit); |