summaryrefslogtreecommitdiffstats
path: root/lib/libthr/arch
diff options
context:
space:
mode:
authormtm <mtm@FreeBSD.org>2003-06-29 00:12:40 +0000
committermtm <mtm@FreeBSD.org>2003-06-29 00:12:40 +0000
commitdffd0ee5d1bb64bc51ea5d11969a289a60abed63 (patch)
tree8f176ce8a22cedcbeffe67b403b6510d65dc36bb /lib/libthr/arch
parent348e423dd913fabaea56f15eecca3d155723ee08 (diff)
downloadFreeBSD-src-dffd0ee5d1bb64bc51ea5d11969a289a60abed63.zip
FreeBSD-src-dffd0ee5d1bb64bc51ea5d11969a289a60abed63.tar.gz
The move to _retire() a thread in the GC instead of in the thread's
exit function has invalidated the need for _spin[un]lock_pthread(). The _spin[un]lock() functions can now dereference curthread without the danger that the ldtentry containing the pointer to the thread has been cleared out from under them.
Diffstat (limited to 'lib/libthr/arch')
-rw-r--r--lib/libthr/arch/i386/i386/_setcurthread.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libthr/arch/i386/i386/_setcurthread.c b/lib/libthr/arch/i386/i386/_setcurthread.c
index 81db3e9..1960c0e 100644
--- a/lib/libthr/arch/i386/i386/_setcurthread.c
+++ b/lib/libthr/arch/i386/i386/_setcurthread.c
@@ -75,15 +75,13 @@ ldt_init(void)
void
_retire_thread(void *entry)
{
- pthread_t thr = curthread;
-
- _spinlock_pthread(thr, &ldt_lock);
+ _spinlock(&ldt_lock);
if (ldt_free == NULL)
*(void **)entry = NULL;
else
*(void **)entry = *ldt_free;
ldt_free = entry;
- _spinunlock_pthread(thr, &ldt_lock);
+ _spinunlock(&ldt_lock);
}
void *
OpenPOWER on IntegriCloud