summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_create.c
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2006-07-13 22:45:19 +0000
committerdavidxu <davidxu@FreeBSD.org>2006-07-13 22:45:19 +0000
commit2b1dbc0acb716180145708fa4f5787322ac795e2 (patch)
tree38d9ff271ff8237cbfb86fa05d16da871f8e0dd2 /lib/libthr/thread/thr_create.c
parent27c2ca32122c31456d60bac89aae091ff18728b0 (diff)
downloadFreeBSD-src-2b1dbc0acb716180145708fa4f5787322ac795e2.zip
FreeBSD-src-2b1dbc0acb716180145708fa4f5787322ac795e2.tar.gz
Caching scheduling policy and priority in userland, a critical but baddly
written application is frequently changing thread priority for SCHED_OTHER policy.
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r--lib/libthr/thread/thr_create.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c
index 49e9b45..f0d7cd5 100644
--- a/lib/libthr/thread/thr_create.c
+++ b/lib/libthr/thread/thr_create.c
@@ -79,10 +79,9 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr,
new_thread->attr.flags |= PTHREAD_SCOPE_SYSTEM;
else
new_thread->attr.flags &= ~PTHREAD_SCOPE_SYSTEM;
- /*
- * scheduling policy and scheduling parameters will be
- * inherited in following code.
- */
+
+ new_thread->attr.prio = curthread->attr.prio;
+ new_thread->attr.sched_policy = curthread->attr.sched_policy;
}
if (_thr_scope_system > 0)
OpenPOWER on IntegriCloud