summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-10 14:54:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-08-10 14:54:50 +0000
commite2936c16766e85cc9c61514e02917399afff6f5d (patch)
treeb61cf7b45e601b9d0d891cf292c1186255f814e3
parent7e693135877069595b6ce706e638e4b25de76da5 (diff)
downloadruby-e2936c16766e85cc9c61514e02917399afff6f5d.tar.gz
ruby-e2936c16766e85cc9c61514e02917399afff6f5d.tar.xz
ruby-e2936c16766e85cc9c61514e02917399afff6f5d.zip
* thread.c (thread_create_core): inherit the priority of creating
thread. submitted at [ruby-core:11873] by David Flanagan <david AT davidflanagan.com>. [ruby-core:11876] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12915 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--thread.c2
-rw-r--r--thread_pthread.ci1
3 files changed, 6 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index ae0967902..2b9188d3a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,8 @@
-Fri Aug 10 09:47:32 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Fri Aug 10 23:54:46 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
- * thread_pthread.ci (native_thread_apply_priority): set actually
- applied prority. [ruby-core:11876]
+ * thread.c (thread_create_core): inherit the priority of creating
+ thread. submitted at [ruby-core:11873] by David Flanagan <david AT
+ davidflanagan.com>. [ruby-core:11876]
Fri Aug 10 05:12:19 2007 Nobuyoshi Nakada <nobu@ruby-lang.org>
diff --git a/thread.c b/thread.c
index f5c277359..301d67137 100644
--- a/thread.c
+++ b/thread.c
@@ -367,6 +367,8 @@ thread_create_core(VALUE klass, VALUE args, VALUE (*fn)(ANYARGS), void *arg)
th->first_func = fn;
th->first_func_arg = arg;
+ th->priority = GET_THREAD()->priority;
+
native_mutex_initialize(&th->interrupt_lock);
/* kick thread */
st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
diff --git a/thread_pthread.ci b/thread_pthread.ci
index f9498f878..d624e9848 100644
--- a/thread_pthread.ci
+++ b/thread_pthread.ci
@@ -285,7 +285,6 @@ native_thread_apply_priority(rb_thread_t *th)
else if (max > priority) {
priority = min;
}
- th->priority = 0 - priority;
sp.sched_priority = priority;
pthread_setschedparam(th->thread_id, policy, &sp);