Implement _get_curthread and _set_curthread. We use GCCs builtin

function this, which expands to PAL calls (rduniq and wruniq).
This needs adjustment when TLS is implemented.
This commit is contained in:
Marcel Moolenaar 2003-07-24 07:51:49 +00:00
parent e180afe760
commit c24297c0f2
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=117959

View File

@ -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