aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-05-17 10:09:50 +0000
committerUlrich Drepper <drepper@redhat.com>1999-05-17 10:09:50 +0000
commit431c33c0bc7cb43231da4364187e0161b0541071 (patch)
tree56976a8674f9ba49073bbfba93397e684180eb8c /linuxthreads
parent15925412407840399fbc6ca2ab49ad92d3369896 (diff)
downloadglibc-431c33c0bc7cb43231da4364187e0161b0541071.tar
glibc-431c33c0bc7cb43231da4364187e0161b0541071.tar.gz
glibc-431c33c0bc7cb43231da4364187e0161b0541071.tar.bz2
glibc-431c33c0bc7cb43231da4364187e0161b0541071.zip
Update.
1999-05-16 Wolfram Gloger <wmglo@dent.med.uni-muenchen.de> * 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 <schwab@issan.cs.uni-dortmund.de> * stdlib/tst-strtod.c: Fix typo. 1999-05-16 Andreas Schwab <schwab@issan.cs.uni-dortmund.de> * elf/dl-close.c (_dl_close): Add cast to avoid warning about const incorrectness.
Diffstat (limited to 'linuxthreads')
-rw-r--r--linuxthreads/ChangeLog9
-rw-r--r--linuxthreads/manager.c12
2 files changed, 20 insertions, 1 deletions
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 <Xavier.Leroy@inria.fr>
+
+ * 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 <drepper@cygnus.com>
* 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;
}