summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-02 01:04:31 +0000
committerwanabe <wanabe@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-02 01:04:31 +0000
commit71f0685fe360a87af23bdeed92b0ebeea0d4690e (patch)
tree03a6bbc838ba2e5c8e51cb2628ca4dd3c43ee02e /cont.c
parent3e364a0c8bcb5aadb09acc929f8a0ca79cbabbfb (diff)
revert r25623
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/cont.c b/cont.c
index 9e80fb5068..9021333ba4 100644
--- a/cont.c
+++ b/cont.c
@@ -198,8 +198,7 @@ fiber_free(void *ptr)
if (ptr) {
rb_fiber_t *fib = ptr;
- if (fib->cont.type != ROOT_FIBER_CONTEXT &&
- fib->cont.saved_thread.local_storage) {
+ if (fib->cont.type != ROOT_FIBER_CONTEXT) {
st_free_table(fib->cont.saved_thread.local_storage);
}
fiber_link_remove(fib);
@@ -284,7 +283,6 @@ cont_init(rb_context_t *cont, rb_thread_t *th)
{
/* save thread context */
cont->saved_thread = *th;
- cont->saved_thread.local_storage = 0;
}
static rb_context_t *
@@ -733,7 +731,6 @@ fiber_t_alloc(VALUE fibval)
cont_init(&fib->cont, th);
fib->prev = Qnil;
fib->status = CREATED;
- fib->prev_fiber = fib->next_fiber = fib;
DATA_PTR(fibval) = fib;
@@ -747,6 +744,8 @@ fiber_init(VALUE fibval, VALUE proc)
rb_context_t *cont = &fib->cont;
rb_thread_t *th = &cont->saved_thread;
+ fiber_link_join(fib);
+
/* initialize cont */
cont->vm_stack = 0;
@@ -754,8 +753,6 @@ fiber_init(VALUE fibval, VALUE proc)
th->stack_size = FIBER_VM_STACK_SIZE;
th->stack = ALLOC_N(VALUE, th->stack_size);
- fiber_link_join(fib);
-
th->cfp = (void *)(th->stack + th->stack_size);
th->cfp--;
th->cfp->pc = 0;
@@ -878,6 +875,7 @@ root_fiber_alloc(rb_thread_t *th)
/* no need to allocate vm stack */
fib = fiber_t_alloc(fiber_alloc(rb_cFiber));
fib->cont.type = ROOT_FIBER_CONTEXT;
+ fib->prev_fiber = fib->next_fiber = fib;
return fib;
}