diff --git a/ChangeLog b/ChangeLog index ae09679023..2b9188d3a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,8 @@ -Fri Aug 10 09:47:32 2007 Nobuyoshi Nakada +Fri Aug 10 23:54:46 2007 Nobuyoshi Nakada - * 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 . [ruby-core:11876] Fri Aug 10 05:12:19 2007 Nobuyoshi Nakada diff --git a/thread.c b/thread.c index f5c2773599..301d67137a 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 f9498f8786..d624e98487 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);