From 431c33c0bc7cb43231da4364187e0161b0541071 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 17 May 1999 10:09:50 +0000 Subject: Update. 1999-05-16 Wolfram Gloger * malloc/malloc.c: Cleanup to bring in line with released stand-alone version `ptmalloc'. Update some comments. (internal_function): Move fallback definition so that the source compiles outside of libc, and use it in more places. (malloc_atfork): Fix when malloc_check is in use. 1999-05-16 Andreas Schwab * stdlib/tst-strtod.c: Fix typo. 1999-05-16 Andreas Schwab * elf/dl-close.c (_dl_close): Add cast to avoid warning about const incorrectness. --- linuxthreads/ChangeLog | 9 +++++++++ linuxthreads/manager.c | 12 +++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) (limited to 'linuxthreads') diff --git a/linuxthreads/ChangeLog b/linuxthreads/ChangeLog index 9c45f6e746..9e30a35ee7 100644 --- a/linuxthreads/ChangeLog +++ b/linuxthreads/ChangeLog @@ -1,3 +1,12 @@ +1999-05-16 Xavier Leroy + + * manager.c: If pthread_create() is given a NULL attribute + and the thread manager runs with a realtime policy, set the + scheduling policy of the newly created thread back to SCHED_OTHER. + * manager.c: If the PTHREAD_INHERIT_SCHED attribute is given, + initialize the schedpolicy field of new_thread->p_start_args + to that of the calling thread. + 1999-04-29 Ulrich Drepper * sysdeps/sparc/sparc64/pt-machine.h (__compare_and_swap): cas diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c index 6bafc868c1..eee4b5c1e1 100644 --- a/linuxthreads/manager.c +++ b/linuxthreads/manager.c @@ -189,9 +189,19 @@ static int pthread_start_thread(void *arg) sigprocmask(SIG_SETMASK, &self->p_start_args.mask, NULL); /* Set the scheduling policy and priority for the new thread, if needed */ if (THREAD_GETMEM(self, p_start_args.schedpolicy) >= 0) + /* Explicit scheduling attributes were provided: apply them */ __sched_setscheduler(THREAD_GETMEM(self, p_pid), THREAD_GETMEM(self, p_start_args.schedpolicy), &self->p_start_args.schedparam); +else if (__pthread_manager_thread.p_priority > 0) + /* Default scheduling required, but thread manager runs in realtime + scheduling: switch new thread to SCHED_OTHER policy */ + { + struct sched_param default_params; + default_params.sched_priority = 0; + __sched_setscheduler(THREAD_GETMEM(self, p_pid), + SCHED_OTHER, &default_params); + } /* Make gdb aware of new thread */ if (__pthread_threads_debug && __pthread_sig_debug > 0) { request.req_thread = self; @@ -347,7 +357,7 @@ static int pthread_handle_create(pthread_t *thread, const pthread_attr_t *attr, sizeof (struct sched_param)); break; case PTHREAD_INHERIT_SCHED: - /* schedpolicy doesn't need to be set, only get priority */ + new_thread->p_start_args.schedpolicy = __sched_getscheduler(father_pid); __sched_getparam(father_pid, &new_thread->p_start_args.schedparam); break; } -- cgit 1.4.1