mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
2003-03-10 Roland McGrath <roland@redhat.com>
* allocatestack.c (allocate_stack) [!TLS_MULTIPLE_THREADS_IN_TCB]: Instead of setting PD->multiple_threads, set globals __pthread_multiple_threads and __libc_multiple_threads. * sysdeps/pthread/createthread.c (create_thread): Likewise. * sysdeps/i386/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Define it. * sysdeps/s390/tls.h (TLS_MULTIPLE_THREADS_IN_TCB): Likewise. * descr.h (struct pthread): Conditionalize first member on [!TLS_DTV_AT_TP]. Replace the `header' member with an anonymous union containing an anonymous tcbhead_t. Move `list' member out. [TLS_MULTIPLE_THREADS_IN_TCB]: Define a `multiple_threads' member. * allocatestack.c: Remove use of `header.data.' prefix. * pthread_create.c: Likewise. * init.c (__pthread_initialize_minimal_internal): Likewise. * sysdeps/pthread/createthread.c (create_thread): Likewise. * sysdeps/i386/tls.h (INSTALL_DTV): Add parens. (THREAD_SELF, THREAD_DTV, INSTALL_NEW_DTV): No `header.data.' prefix. * sysdeps/x86_64/tls.h: Likewise. * sysdeps/unix/sysv/linux/i386/sysdep-cancel.h (SINGLE_THREAD_P): Likewise. * sysdeps/unix/sysv/linux/sh/sysdep-cancel.h (SINGLE_THREAD_P): Likewise. * sysdeps/i386/tls.h (tcbhead_t): Remove `list' member. * sysdeps/s390/tls.h (tcbhead_t): Likewise.
This commit is contained in:
@ -42,7 +42,7 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
|
||||
PREPARE_CREATE;
|
||||
#endif
|
||||
|
||||
assert (pd->header.data.tcb != NULL);
|
||||
assert (pd->tcb != NULL);
|
||||
|
||||
|
||||
if (__builtin_expect (THREAD_GETMEM (THREAD_SELF, report_events), 0))
|
||||
@ -70,8 +70,12 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
|
||||
/* Failed. */
|
||||
return errno;
|
||||
|
||||
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
|
||||
/* We now have for sure more than one thread. */
|
||||
pd->header.data.multiple_threads = 1;
|
||||
pd->multiple_threads = 1;
|
||||
#else
|
||||
__pthread_multiple_threads = __libc_multiple_threads = 1;
|
||||
#endif
|
||||
|
||||
/* Now fill in the information about the new thread in
|
||||
the newly created thread's data structure. We cannot let
|
||||
@ -97,8 +101,7 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
|
||||
}
|
||||
|
||||
#ifdef NEED_DL_SYSINFO
|
||||
assert (THREAD_GETMEM (THREAD_SELF, header.data.sysinfo)
|
||||
== pd->header.data.sysinfo);
|
||||
assert (THREAD_GETMEM (THREAD_SELF, sysinfo) == pd->sysinfo);
|
||||
#endif
|
||||
|
||||
/* We rely heavily on various flags the CLONE function understands:
|
||||
@ -139,8 +142,10 @@ create_thread (struct pthread *pd, STACK_VARIABLES_PARMS)
|
||||
/* Failed. */
|
||||
return errno;
|
||||
|
||||
#ifdef TLS_MULTIPLE_THREADS_IN_TCB
|
||||
/* We now have for sure more than one thread. */
|
||||
THREAD_SETMEM (THREAD_SELF, header.data.multiple_threads, 1);
|
||||
THREAD_SETMEM (THREAD_SELF, multiple_threads, 1);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user