diff options
Diffstat (limited to 'lib/libthr/arch/alpha/alpha/_curthread.c')
-rw-r--r-- | lib/libthr/arch/alpha/alpha/_curthread.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libthr/arch/alpha/alpha/_curthread.c b/lib/libthr/arch/alpha/alpha/_curthread.c index c6706e9..56166a7 100644 --- a/lib/libthr/arch/alpha/alpha/_curthread.c +++ b/lib/libthr/arch/alpha/alpha/_curthread.c @@ -35,13 +35,18 @@ __FBSDID("$FreeBSD$"); void * _set_curthread(ucontext_t *uc, struct pthread *thread, int *err) { + *err = 0; + if (uc != NULL) + uc->uc_mcontext.mc_thrptr = (uint64_t)thread; + else + __builtin_set_thread_pointer(thread); return (NULL); } struct pthread * _get_curthread(void) { - return (NULL); + return (__builtin_thread_pointer()); } void |