diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-28 19:04:45 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-28 19:04:45 +0000 |
commit | 534d057e58e68c5a65509e718366f2dab5e69e84 (patch) | |
tree | 847cd2a9901e73ccb88f801c813842d857626af2 /cont.c | |
parent | 4dc8ff965bea4226c36acae8880dc359e05414dd (diff) | |
download | ruby-534d057e58e68c5a65509e718366f2dab5e69e84.tar.gz |
* 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
Diffstat (limited to 'cont.c')
-rw-r--r-- | cont.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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; |