diff options
author | Ulrich Drepper <drepper@redhat.com> | 2003-08-03 06:47:02 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2003-08-03 06:47:02 +0000 |
commit | f1205aa71fb0131eb9d1e2efdd5fbcfaa85ad27c (patch) | |
tree | 7459ac5d9ff530a22b4035697530a49e49ce3ff7 /nptl/pthread_create.c | |
parent | 0cbc6c4eba0d6c957917e036a0822c84b92443fc (diff) | |
download | glibc-f1205aa71fb0131eb9d1e2efdd5fbcfaa85ad27c.tar.gz glibc-f1205aa71fb0131eb9d1e2efdd5fbcfaa85ad27c.tar.xz glibc-f1205aa71fb0131eb9d1e2efdd5fbcfaa85ad27c.zip |
Update.
* sysdeps/pthread/createthread.c (do_clone): If __ASSUME_CLONE_STOPPED is not defined, do explicit synchronization. (create_thread): Do not lock pd->lock here. If __ASSUME_CLONE_STOPPED is not defined also unlock pd->lock for non-debugging case in case it is necessary. * pthread_create.c (start_thread): Always get and release pd->lock if __ASSUME_CLONE_STOPPED is not defined. (start_thread_debug): Removed. Adjust users. * allocatestack.c (allocate_stack): Always initialize lock if __ASSUME_CLONE_STOPPED is not defined. * Makefile (tests): Add tst-sched1. * tst-sched1.c: New file.
Diffstat (limited to 'nptl/pthread_create.c')
-rw-r--r-- | nptl/pthread_create.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index ae97f4a62d..8507c3bf1d 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -33,8 +33,6 @@ /* Local function to start thread and handle cleanup. */ static int start_thread (void *arg); -/* Similar version used when debugging. */ -static int start_thread_debug (void *arg); /* Nozero if debugging mode is enabled. */ @@ -232,6 +230,13 @@ start_thread (void *arg) struct pthread *pd = (struct pthread *) arg; +#ifndef __ASSUME_CLONE_STOPPED + /* Get the lock the parent locked to force synchronization. */ + lll_lock (pd->lock); + /* And give it up right away. */ + lll_unlock (pd->lock); +#endif + #if HP_TIMING_AVAIL /* Remember the time when the thread was started. */ hp_timing_t now; @@ -331,23 +336,6 @@ start_thread (void *arg) } -/* Just list start_thread but we do some more things needed for a run - with a debugger attached. */ -static int -start_thread_debug (void *arg) -{ - struct pthread *pd = (struct pthread *) arg; - - /* Get the lock the parent locked to force synchronization. */ - lll_lock (pd->lock); - /* And give it up right away. */ - lll_unlock (pd->lock); - - /* Now do the actual startup. */ - return start_thread (arg); -} - - /* Default thread attributes for the case when the user does not provide any. */ static const struct pthread_attr default_attr = |