From e24c161e9d16483a1d97402557f7756e26afb6cf Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Wed, 13 Jun 2007 00:00:00 +0200 Subject: TLS support for libthreads. * libthreads/cprocs.c (cproc_create): Call into glibc to allocate static TLS block. * libthreads/cthread_internals.h (tcbhead_t): New structure; as in glibc. (cproc_setup): Take TCB parameter. (_dl_allocate_tls): Declare; from glibc. * libthreads/alpha/thread.c (cproc_setup): Compile-time warning for missing TLS support. * libthreads/i386/thread.c (cproc_setup): Imlement TLS support. --- libthreads/cprocs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libthreads/cprocs.c') diff --git a/libthreads/cprocs.c b/libthreads/cprocs.c index 2195039c..7f63fc0d 100644 --- a/libthreads/cprocs.c +++ b/libthreads/cprocs.c @@ -725,10 +725,11 @@ cproc_create(void) spin_lock(&n_kern_lock); if (cthread_max_kernel_threads == 0 || cthread_kernel_threads < cthread_max_kernel_threads) { + tcbhead_t *tcb = _dl_allocate_tls(NULL); cthread_kernel_threads++; spin_unlock(&n_kern_lock); MACH_CALL(thread_create(mach_task_self(), &n), r); - cproc_setup(child, n, cthread_body); /* machine dependent */ + cproc_setup(child, n, tcb, cthread_body); /* machine dependent */ MACH_CALL(thread_resume(n), r); #ifdef STATISTICS spin_lock(&ready_lock); -- cgit v1.2.3