mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread_pthread.c (rb_thread_create_timer_thread): do not wait never
coming signal if failed to create tiemr thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
006be2d790
commit
b15e0697fd
2 changed files with 7 additions and 3 deletions
|
@ -1,4 +1,7 @@
|
|||
Sat Nov 8 01:42:13 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Sat Nov 8 01:48:07 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread_pthread.c (rb_thread_create_timer_thread): do not wait never
|
||||
coming signal if failed to create tiemr thread.
|
||||
|
||||
* thread_pthread.c (native_cond_timedwait): returns error code.
|
||||
|
||||
|
|
|
@ -719,11 +719,12 @@ rb_thread_create_timer_thread(void)
|
|||
#endif
|
||||
native_mutex_lock(&timer_thread_lock);
|
||||
err = pthread_create(&timer_thread_id, &attr, thread_timer, 0);
|
||||
native_cond_wait(&timer_thread_cond, &timer_thread_lock);
|
||||
native_mutex_unlock(&timer_thread_lock);
|
||||
if (err != 0) {
|
||||
native_mutex_unlock(&timer_thread_lock);
|
||||
rb_bug("rb_thread_create_timer_thread: return non-zero (%d)", err);
|
||||
}
|
||||
native_cond_wait(&timer_thread_cond, &timer_thread_lock);
|
||||
native_mutex_unlock(&timer_thread_lock);
|
||||
}
|
||||
rb_disable_interrupt(); /* only timer thread recieve signal */
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue