summaryrefslogtreecommitdiff
path: root/libpthread/linuxthreads
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2003-01-23 07:57:02 +0000
committerEric Andersen <andersen@codepoet.org>2003-01-23 07:57:02 +0000
commit7e6a89bcf073ba896a01793098c84462fd0f5f3b (patch)
tree6145e956f156e7f9d8a1447aa48a05cda60e52fe /libpthread/linuxthreads
parent8286f90e97e48c0b3b02097be1ac54f30216dfaa (diff)
Per patch from Nathan Field at ghs.com, fix __pthread_initialize_manager so it
locks before calling clone when under a debugger, and unlocks on success or failure of clone when under a debugger.
Diffstat (limited to 'libpthread/linuxthreads')
-rw-r--r--libpthread/linuxthreads/pthread.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libpthread/linuxthreads/pthread.c b/libpthread/linuxthreads/pthread.c
index 5142d4c13..ace6ac9eb 100644
--- a/libpthread/linuxthreads/pthread.c
+++ b/libpthread/linuxthreads/pthread.c
@@ -384,6 +384,9 @@ int __pthread_initialize_manager(void)
| __pthread_initial_thread.p_eventbuf.eventmask.event_bits[idx]))
!= 0)
{
+
+ __pthread_lock(__pthread_manager_thread.p_lock, NULL);
+
pid = clone(__pthread_manager_event,
(void **) __pthread_manager_thread_tos,
CLONE_VM | CLONE_FS | CLONE_FILES | CLONE_SIGHAND,
@@ -404,10 +407,9 @@ int __pthread_initialize_manager(void)
/* Now call the function which signals the event. */
__linuxthreads_create_event ();
-
- /* Now restart the thread. */
- __pthread_unlock(__pthread_manager_thread.p_lock);
}
+ /* Now restart the thread. */
+ __pthread_unlock(__pthread_manager_thread.p_lock);
}
}