summaryrefslogtreecommitdiffstats
path: root/thread_pthread.ci
diff options
context:
space:
mode:
authorusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-10 06:53:39 +0000
committerusa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-04-10 06:53:39 +0000
commitc2b3083f6ef9a8948b783a2149301c197bdac631 (patch)
tree37e2c1ab2fd866613fbca6c14b0ea814dbcb262d /thread_pthread.ci
parentfec442d641a00401fd4525586504758137798796 (diff)
downloadruby-c2b3083f6ef9a8948b783a2149301c197bdac631.tar.gz
ruby-c2b3083f6ef9a8948b783a2149301c197bdac631.tar.xz
ruby-c2b3083f6ef9a8948b783a2149301c197bdac631.zip
* thread_pthread.ci (native_thread_create): initialize sleep_cond.
fixed: [ruby-dev:30675] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@12163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_pthread.ci')
-rw-r--r--thread_pthread.ci5
1 files changed, 4 insertions, 1 deletions
diff --git a/thread_pthread.ci b/thread_pthread.ci
index 595bb8e8f..34bb5362b 100644
--- a/thread_pthread.ci
+++ b/thread_pthread.ci
@@ -247,7 +247,10 @@ native_thread_create(rb_thread_t *th)
thread_debug("create: %p (%d)", th, err);
CHECK_ERR(pthread_attr_destroy(&attr));
- if (err != 0) {
+ if (!err) {
+ pthread_cond_init(&th->native_thread_data.sleep_cond, 0);
+ }
+ else {
st_delete_wrap(th->vm->living_threads, th->self);
th->status = THREAD_KILLED;
rb_raise(rb_eThreadError, "can't create Thread (%d)", err);