summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads.old/pthread.c
diff options
context:
space:
mode:
authorHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2009-12-16 13:12:00 +0100
committerHans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>2009-12-17 13:42:26 +0100
commite092e7c30464555b3fb81adc8f2f479e892b0786 (patch)
tree8aed900855f09f0e93d7808339a01816d5d798a8 /libpthread/linuxthreads.old/pthread.c
parent197b2de50d7c025b6a25e7e1cde7a5667728c15c (diff)
check if USE_TLS is defined before use
This patch will convert all the #ifdef USE_TLS and #if USE_TLS to #if defined(USE_TLS) && USE_TLS. By checking if the USE_TLS is defined before checking its value will result in correct behavior for architectures not defining this config symbol. Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com> Acked-by: Carmelo AMOROSO <carmelo.amoroso@st.com>
Diffstat (limited to 'libpthread/linuxthreads.old/pthread.c')
-rw-r--r--libpthread/linuxthreads.old/pthread.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpthread/linuxthreads.old/pthread.c b/libpthread/linuxthreads.old/pthread.c
index c988131fc..ad392e34e 100644
--- a/libpthread/linuxthreads.old/pthread.c
+++ b/libpthread/linuxthreads.old/pthread.c
@@ -537,7 +537,7 @@ int __pthread_initialize_manager(void)
}
/* Start the thread manager */
pid = 0;
-#ifdef USE_TLS
+#if defined(USE_TLS) && USE_TLS
if (__linuxthreads_initial_report_events != 0)
THREAD_SETMEM (((pthread_descr) NULL), p_report_events,
__linuxthreads_initial_report_events);
@@ -710,7 +710,7 @@ static pthread_descr thread_self_stack(void)
if (sp >= __pthread_manager_thread_bos && sp < __pthread_manager_thread_tos)
return manager_thread;
h = __pthread_handles + 2;
-# ifdef USE_TLS
+# if defined(USE_TLS) && USE_TLS
while (h->h_descr == NULL
|| ! (sp <= (char *) h->h_descr->p_stackaddr && sp >= h->h_bottom))
h++;
@@ -845,7 +845,7 @@ static void pthread_handle_sigcancel(int sig)
/* Main thread should accumulate times for thread manager and its
children, so that timings for main thread account for all threads. */
if (self == __pthread_main_thread) {
-#ifdef USE_TLS
+#if defined(USE_TLS) && USE_TLS
waitpid(__pthread_manager_thread->p_pid, NULL, __WCLONE);
#else
waitpid(__pthread_manager_thread.p_pid, NULL, __WCLONE);