From e708e2af80f403ba868d5cd095bd87913fc88c56 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Mon, 19 Mar 2018 01:53:45 +0100 Subject: Remove ENABLE_TLS define * Makefile (CPPFLAGS): Remove -DENABLE_TLS. * pthread/pt-alloc.c: Remove ENABLE_TLS condition. * pthread/pt-create.c: Likewise. * pthread/pt-internal.h: Likewise. --- Makefile | 1 - pthread/pt-alloc.c | 4 ---- pthread/pt-create.c | 6 ------ pthread/pt-internal.h | 4 ---- 4 files changed, 15 deletions(-) diff --git a/Makefile b/Makefile index 79cda56..54aa575 100644 --- a/Makefile +++ b/Makefile @@ -190,7 +190,6 @@ SYSDEP_PATH = $(srcdir)/sysdeps/$(MICROKERNEL)/hurd/i386 \ VPATH += $(SYSDEP_PATH) CPPFLAGS += \ - -DENABLE_TLS \ $(addprefix -I, $(SYSDEP_PATH)) CFLAGS-lockfile.c = -D_IO_MTSAFE_IO diff --git a/pthread/pt-alloc.c b/pthread/pt-alloc.c index f4634de..22a3000 100644 --- a/pthread/pt-alloc.c +++ b/pthread/pt-alloc.c @@ -69,9 +69,7 @@ initialize_pthread (struct __pthread *new) memset (&new->res_state, '\0', sizeof (new->res_state)); -#ifdef ENABLE_TLS new->tcb = NULL; -#endif new->next = 0; new->prevp = 0; @@ -111,13 +109,11 @@ __pthread_alloc (struct __pthread **pthread) if (new) { -#ifdef ENABLE_TLS if (new->tcb) { /* Drop old values */ _dl_deallocate_tls (new->tcb, 1); } -#endif /* ENABLE_TLS */ err = initialize_pthread (new); if (! err) diff --git a/pthread/pt-create.c b/pthread/pt-create.c index cf226cc..41e8507 100644 --- a/pthread/pt-create.c +++ b/pthread/pt-create.c @@ -44,10 +44,8 @@ unsigned int __pthread_total; static void entry_point (struct __pthread *self, void *(*start_routine)(void *), void *arg) { -#ifdef ENABLE_TLS ___pthread_self = self; __resp = &self->res_state; -#endif #if IS_IN (libpthread) /* Initialize pointers to locale data. */ @@ -147,7 +145,6 @@ __pthread_create_internal (struct __pthread **thread, if (err) goto failed_thread_alloc; -#ifdef ENABLE_TLS pthread->tcb = _dl_allocate_tls (NULL); if (!pthread->tcb) { @@ -155,7 +152,6 @@ __pthread_create_internal (struct __pthread **thread, goto failed_thread_tls_alloc; } pthread->tcb->tcb = pthread->tcb; -#endif /* ENABLE_TLS */ /* And initialize the rest of the machine context. This may include additional machine- and system-specific initializations that @@ -230,11 +226,9 @@ __pthread_create_internal (struct __pthread **thread, failed_sigstate: __pthread_sigstate_destroy (pthread); failed_setup: -#ifdef ENABLE_TLS _dl_deallocate_tls (pthread->tcb, 1); pthread->tcb = NULL; failed_thread_tls_alloc: -#endif /* ENABLE_TLS */ __pthread_thread_terminate (pthread); /* __pthread_thread_terminate has taken care of deallocating the stack and diff --git a/pthread/pt-internal.h b/pthread/pt-internal.h index 24111ad..1f17f25 100644 --- a/pthread/pt-internal.h +++ b/pthread/pt-internal.h @@ -59,7 +59,6 @@ enum pthread_state #endif #if !(IS_IN (libpthread)) -#ifdef ENABLE_TLS /* Type of the TCB. */ typedef struct { @@ -67,7 +66,6 @@ typedef struct void *dtv; /* Vector of pointers to TLS data. */ thread_t self; /* This thread's control port. */ } tcbhead_t; -#endif /* ENABLE_TLS */ #endif /* ! IS_IN (libpthread) */ /* This structure describes a POSIX thread. */ @@ -117,9 +115,7 @@ struct __pthread PTHREAD_SYSDEP_MEMBERS -#ifdef ENABLE_TLS tcbhead_t *tcb; -#endif /* ENABLE_TLS */ /* Queue links. Since PREVP is used to determine if a thread has been awaken, it must be protected by the queue lock. */ -- cgit v1.2.3