aboutsummaryrefslogtreecommitdiffstats
path: root/yarvcore.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-06 18:19:42 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-06-06 18:19:42 +0000
commitd80e7373cfb0ca1558bdeb79643c53db5f9ce4d8 (patch)
treea0f9bd31081dda1430be6d7df5649515832c8835 /yarvcore.c
parented8897523701745467cf831ff19ec3268856cf6e (diff)
downloadruby-d80e7373cfb0ca1558bdeb79643c53db5f9ce4d8.tar.gz
* cont.c (cont_new): add debug message.
* cont.c (cont_restore_1): copy stack information from fiber. * cont.c (rb_fiber_s_new): fix to mark created fiber. * test/ruby/test_fiber.rb: add some tests around Thread and Fiber. * yarvcore.c (thread_free): fix to skip freeing stack if root fiber is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12454 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'yarvcore.c')
-rw-r--r--yarvcore.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/yarvcore.c b/yarvcore.c
index 507a2f8c68..6c4f83294c 100644
--- a/yarvcore.c
+++ b/yarvcore.c
@@ -226,7 +226,10 @@ thread_free(void *ptr)
if (ptr) {
th = ptr;
- FREE_UNLESS_NULL(th->stack);
+
+ if (!th->root_fiber) {
+ FREE_UNLESS_NULL(th->stack);
+ }
if (th->local_storage) {
st_free_table(th->local_storage);