diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 16:48:22 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-07 16:48:22 +0000 |
commit | b15e0697fdb6f89c93910e20296691e7fdddb8ff (patch) | |
tree | 570639351ef65d50052011ad75ff29858fd40931 /thread_pthread.c | |
parent | 006be2d79020f3ad6f4ba644e35d0cec1d8d42fd (diff) | |
download | ruby-b15e0697fdb6f89c93910e20296691e7fdddb8ff.tar.gz |
* 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
Diffstat (limited to 'thread_pthread.c')
-rw-r--r-- | thread_pthread.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/thread_pthread.c b/thread_pthread.c index 46a86192e1..5fc335b304 100644 --- a/thread_pthread.c +++ b/thread_pthread.c @@ -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 */ } |