summaryrefslogtreecommitdiff
path: root/libthreads/cprocs.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2007-06-13 00:00:00 +0200
committerThomas Schwinge <thomas@schwinge.name>2011-10-20 12:50:53 +0200
commite24c161e9d16483a1d97402557f7756e26afb6cf (patch)
treef261f3fbfc270d41067be44472b4af13f3adda71 /libthreads/cprocs.c
parent2a7fb4a54c2ac9cb8396da117f0a05055330599c (diff)
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.
Diffstat (limited to 'libthreads/cprocs.c')
-rw-r--r--libthreads/cprocs.c3
1 files changed, 2 insertions, 1 deletions
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);