зеркало из https://github.com/github/ruby.git
* thread.c (rb_thread_schedule_limits): minor optimization.
eliminate machine context saving when running time is enough small. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
5e15194561
Коммит
c90ff68d32
|
@ -1,3 +1,8 @@
|
|||
Thu Jun 30 02:41:47 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* thread.c (rb_thread_schedule_limits): minor optimization.
|
||||
eliminate machine context saving when running time is enough small.
|
||||
|
||||
Thu Jun 30 02:28:11 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||
|
||||
* thread.c (rb_thread_schedule_rec): move interrupt_flag check to
|
||||
|
|
14
thread.c
14
thread.c
|
@ -1008,15 +1008,13 @@ rb_thread_schedule_limits(unsigned long limits_us)
|
|||
if (!rb_thread_alone()) {
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
|
||||
thread_debug("rb_thread_schedule/switch start\n");
|
||||
|
||||
RB_GC_SAVE_MACHINE_CONTEXT(th);
|
||||
|
||||
if (th->running_time_us >= limits_us)
|
||||
if (th->running_time_us >= limits_us) {
|
||||
thread_debug("rb_thread_schedule/switch start\n");
|
||||
RB_GC_SAVE_MACHINE_CONTEXT(th);
|
||||
gvl_yield(th->vm, th);
|
||||
|
||||
rb_thread_set_current(th);
|
||||
thread_debug("rb_thread_schedule/switch done\n");
|
||||
rb_thread_set_current(th);
|
||||
thread_debug("rb_thread_schedule/switch done\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче