From 534d057e58e68c5a65509e718366f2dab5e69e84 Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 28 Sep 2007 19:04:45 +0000 Subject: * cont.c: Thread local storage should be fiber local. * bootstraptest/test_knownbug.rb, test/ruby/test_fiber.rb: move a fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- cont.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cont.c') diff --git a/cont.c b/cont.c index 1f1912bc84..36baa41ba2 100644 --- a/cont.c +++ b/cont.c @@ -86,6 +86,9 @@ cont_free(void *ptr) RUBY_FREE_UNLESS_NULL(cont->machine_register_stack); #endif RUBY_FREE_UNLESS_NULL(cont->vm_stack); + if (cont->saved_thread.local_storage) { + st_free_table(cont->saved_thread.local_storage); + } ruby_xfree(ptr); } RUBY_FREE_LEAVE("cont"); @@ -205,6 +208,7 @@ cont_restore_1(rb_context_t *cont) /* fiber */ th->stack = sth->stack; th->stack_size = sth->stack_size; + th->local_storage = sth->local_storage; th->fiber = cont->self; } else { @@ -500,6 +504,7 @@ fiber_alloc(VALUE klass, VALUE proc) th->cfp->proc = 0; th->cfp->block_iseq = 0; th->tag = 0; + th->local_storage = st_init_numtable(); th->first_proc = proc; -- cgit v1.2.3