summaryrefslogtreecommitdiff
path: root/thread_pthread.ci
diff options
context:
space:
mode:
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 595bb8e8fb..34bb5362b9 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);