summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 16:48:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-07 16:48:22 +0000
commitc1182fafd35579dca92eaf089d2c1c210475d4dc (patch)
tree570639351ef65d50052011ad75ff29858fd40931
parentdbce5d4065124edec0b1a9961d262a304ff88f33 (diff)
downloadruby-c1182fafd35579dca92eaf089d2c1c210475d4dc.tar.gz
ruby-c1182fafd35579dca92eaf089d2c1c210475d4dc.tar.xz
ruby-c1182fafd35579dca92eaf089d2c1c210475d4dc.zip
* thread_pthread.c (rb_thread_create_timer_thread): do not wait never
coming signal if failed to create tiemr thread. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--thread_pthread.c5
2 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index cc11f7156..e7ec94181 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/thread_pthread.c b/thread_pthread.c
index 46a86192e..5fc335b30 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 */
}