thread_sync.c: remove unnecessary casts for queue_sleep

"Qfalse" and "(VALUE)0" are equivalent, and do not matter
for an ignored argument, either.

Additionally, there's no reason to cast the pointer to
rb_thread_sleep_deadly when we already have a queue_sleep
wrapper.

* thread_sync.c (queue_do_pop): avoid cast with Qfalse
  (rb_szqueue_push): ditto, use queue_sleep wrapper

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53413 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
normal 2016-01-02 12:08:34 +00:00
Родитель 32b4a8b36b
Коммит 004bb16ccc
2 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Sat Jan 2 21:07:55 2016 Eric Wong <e@80x24.org>
* thread_sync.c (queue_do_pop): avoid cast with Qfalse
(rb_szqueue_push): ditto, use queue_sleep wrapper
Sat Jan 2 16:16:14 2016 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/erb.rb: Allow ERB subclass to add token easily.

Просмотреть файл

@ -786,7 +786,7 @@ queue_do_pop(VALUE self, int should_block)
assert(queue_closed_p(self) == 0);
rb_ary_push(args.waiting, args.th);
rb_ensure(queue_sleep, (VALUE)0, queue_delete_from_waiting, (VALUE)&args);
rb_ensure(queue_sleep, Qfalse, queue_delete_from_waiting, (VALUE)&args);
}
}
@ -1012,7 +1012,7 @@ rb_szqueue_push(int argc, VALUE *argv, VALUE self)
}
else {
rb_ary_push(args.waiting, args.th);
rb_ensure((VALUE (*)())rb_thread_sleep_deadly, (VALUE)0, queue_delete_from_waiting, (VALUE)&args);
rb_ensure(queue_sleep, Qfalse, queue_delete_from_waiting, (VALUE)&args);
}
}