mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-07 12:21:14 +03:00
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.
This commit is contained in:
@ -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 =
|
||||
|
Reference in New Issue
Block a user