summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-24 02:00:10 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-24 02:00:10 +0000
commit82b33551a4ead2fa13120751242c493e2084cada (patch)
tree6f12db17afe2305cc966e094906a985cb549112c /thread.c
parentb9163cc1fdb109f214cda44b07f2b960338015f4 (diff)
* thread.c (thread_create_core): don't use th->thread_id before
initialized. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 159dbffc87..64eaadc9b5 100644
--- a/thread.c
+++ b/thread.c
@@ -570,13 +570,12 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
native_mutex_initialize(&th->interrupt_lock);
/* kick thread */
- st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
err = native_thread_create(th);
if (err) {
- st_delete_wrap(th->vm->living_threads, th->self);
th->status = THREAD_KILLED;
rb_raise(rb_eThreadError, "can't create Thread (%d)", err);
}
+ st_insert(th->vm->living_threads, thval, (st_data_t) th->thread_id);
return thval;
}