aboutsummaryrefslogtreecommitdiff
path: root/linuxthreads/manager.c
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/manager.c
parent15925412407840399fbc6ca2ab49ad92d3369896 (diff)
downloadglibc-431c33c0bc7cb43231da4364187e0161b0541071.zip
glibc-431c33c0bc7cb43231da4364187e0161b0541071.tar.gz
glibc-431c33c0bc7cb43231da4364187e0161b0541071.tar.bz2
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/manager.c')
-rw-r--r--linuxthreads/manager.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/linuxthreads/manager.c b/linuxthreads/manager.c
index 6bafc86..eee4b5c 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;
}