1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-07 12:21:14 +03:00
* 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:
Ulrich Drepper
2003-08-03 06:47:02 +00:00
parent 0cbc6c4eba
commit f1205aa71f
6 changed files with 167 additions and 35 deletions

View File

@ -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 =