mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (ubf_select): add to small comments why we
need to call rb_thread_wakeup_timer_thread(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39684 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
383a2579c3
commit
0eeb116923
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Mar 6 22:56:14 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread_pthread.c (ubf_select): add to small comments why we
|
||||||
|
need to call rb_thread_wakeup_timer_thread().
|
||||||
|
|
||||||
Wed Mar 6 21:42:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Wed Mar 6 21:42:24 2013 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* thread_pthread.c (rb_thread_create_timer_thread): factor out
|
* thread_pthread.c (rb_thread_create_timer_thread): factor out
|
||||||
|
|
|
@ -1098,8 +1098,16 @@ ubf_select(void *ptr)
|
||||||
{
|
{
|
||||||
rb_thread_t *th = (rb_thread_t *)ptr;
|
rb_thread_t *th = (rb_thread_t *)ptr;
|
||||||
add_signal_thread_list(th);
|
add_signal_thread_list(th);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* ubf_select_each() doesn't guarantee to wake up the target thread.
|
||||||
|
* Therefore, we need to activate timer thread when called from
|
||||||
|
* Thread#kill etc.
|
||||||
|
* In the other hands, we shouldn't call rb_thread_wakeup_timer_thread()
|
||||||
|
* if running on timer thread because it may make endless wakeups.
|
||||||
|
*/
|
||||||
if (pthread_self() != timer_thread_id)
|
if (pthread_self() != timer_thread_id)
|
||||||
rb_thread_wakeup_timer_thread(); /* activate timer thread */
|
rb_thread_wakeup_timer_thread();
|
||||||
ubf_select_each(th);
|
ubf_select_each(th);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue