summaryrefslogtreecommitdiffstats
path: root/lib/libthr/arch/sparc64
diff options
context:
space:
mode:
authorjake <jake@FreeBSD.org>2003-04-03 03:34:50 +0000
committerjake <jake@FreeBSD.org>2003-04-03 03:34:50 +0000
commit5b2b2811a19544037b626ef44e598691b3b2f525 (patch)
treed95f2bb910f0eebc71243aa5c4f13994c66da5ec /lib/libthr/arch/sparc64
parent12c39a9461b4db1d8608dca0cb0cfc47ff8b234e (diff)
downloadFreeBSD-src-5b2b2811a19544037b626ef44e598691b3b2f525.zip
FreeBSD-src-5b2b2811a19544037b626ef44e598691b3b2f525.tar.gz
- Pass a ucontext_t to _set_curthread. If non-NULL the new thread is set
as curthread in the new context, so that it will be set automatically when the thread is switched to. This fixes a race where we'd run for a little while with curthread unset in _thread_start. Reviewed by: jeff
Diffstat (limited to 'lib/libthr/arch/sparc64')
-rw-r--r--lib/libthr/arch/sparc64/sparc64/_setcurthread.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libthr/arch/sparc64/sparc64/_setcurthread.c b/lib/libthr/arch/sparc64/sparc64/_setcurthread.c
index d37c177..4f1a303 100644
--- a/lib/libthr/arch/sparc64/sparc64/_setcurthread.c
+++ b/lib/libthr/arch/sparc64/sparc64/_setcurthread.c
@@ -48,9 +48,12 @@ _retire_thread(void *v)
}
void *
-_set_curthread(struct pthread *thread)
+_set_curthread(ucontext_t *uc, struct pthread *thread)
{
- _curthread = thread;
+ if (uc != NULL)
+ uc->uc_mcontext.mc_global[6] = (uint64_t)thread;
+ else
+ _curthread = thread;
return (NULL);
}
OpenPOWER on IntegriCloud