aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-08-08 05:20:04 +0000
committerUlrich Drepper <drepper@redhat.com>2002-08-08 05:20:04 +0000
commitfc0154dd777997ff424b4dcde99404b8a3787110 (patch)
tree8f210da17096d8020a4dd2aede475363dc83957e /linuxthreads
parente8e91498709241b718eb0b0de69e23c405d149ab (diff)
downloadglibc-fc0154dd777997ff424b4dcde99404b8a3787110.zip
glibc-fc0154dd777997ff424b4dcde99404b8a3787110.tar.gz
glibc-fc0154dd777997ff424b4dcde99404b8a3787110.tar.bz2
(__linuxthreads_initial_report_events): New variable. (__pthread_initialize_manager): Use it to initialize p_report_events of initial thread. [TLS]: Store pointer to descriptor of manager in __pthread_handles.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/pthread.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/linuxthreads/pthread.c b/linuxthreads/pthread.c
index ae42ebe..cc4d26d 100644
--- a/linuxthreads/pthread.c
+++ b/linuxthreads/pthread.c
@@ -236,6 +236,8 @@ const int __pthread_offsetof_pid = offsetof(struct _pthread_descr_struct,
const int __linuxthreads_pthread_sizeof_descr
= sizeof(struct _pthread_descr_struct);
+const int __linuxthreads_initial_report_events;
+
/* Forward declarations */
static void pthread_onexit_process(int retcode, void *arg);
@@ -622,7 +624,7 @@ int __pthread_initialize_manager(void)
#ifdef USE_TLS
/* Allocate memory for the thread descriptor and the dtv. */
- manager_thread = tcb = _dl_allocate_tls ();
+ __pthread_handles[1].h_descr = manager_thread = tcb = _dl_allocate_tls ();
if (tcb == NULL) {
free(__pthread_manager_thread_bos);
__libc_close(manager_pipe[0]);
@@ -651,8 +653,14 @@ int __pthread_initialize_manager(void)
/* Start the thread manager */
pid = 0;
#ifdef USE_TLS
+ if (__linuxthreads_initial_report_events != 0)
+ THREAD_SETMEM (((pthread_descr) NULL), p_report_events,
+ __linuxthreads_initial_report_events);
report_events = THREAD_GETMEM (((pthread_descr) NULL), p_report_events);
#else
+ if (__linuxthreads_initial_report_events != 0)
+ __pthread_initial_thread.p_report_events
+ = __linuxthreads_initial_report_events;
report_events = __pthread_initial_thread.p_report_events;
#endif
if (__builtin_expect (report_events, 0))