Project

General

Profile

Backport #5700 » bug5700.patch

nagachika (Tomoyuki Chikanaga), 02/10/2012 12:30 PM

View differences:

cont.c
return size;
}
VALUE
rb_obj_is_fiber(VALUE obj)
{
if (rb_typeddata_is_kind_of(obj, &fiber_data_type)) {
return Qtrue;
}
else {
return Qfalse;
}
}
static void
cont_save_machine_stack(rb_thread_t *th, rb_context_t *cont)
{
......
return rb_fiber_transfer(return_fiber(), argc, argv);
}
void
rb_fiber_reset_root_local_storage(VALUE thval)
{
rb_thread_t *th;
rb_fiber_t *fib;
GetThreadPtr(thval, th);
if (th->root_fiber && th->root_fiber != th->fiber) {
GetFiberPtr(th->root_fiber, fib);
th->local_storage = fib->cont.saved_thread.local_storage;
}
}
/*
* call-seq:
* fiber.alive? -> true or false
gc.c
while (p < pend) {
if (BUILTIN_TYPE(p) == T_DATA &&
DATA_PTR(p) && RANY(p)->as.data.dfree &&
!rb_obj_is_thread((VALUE)p) && !rb_obj_is_mutex((VALUE)p) ) {
!rb_obj_is_thread((VALUE)p) && !rb_obj_is_mutex((VALUE)p) &&
!rb_obj_is_fiber((VALUE)p)) {
p->as.free.flags = 0;
if (RTYPEDDATA_P(p)) {
RDATA(p)->dfree = RANY(p)->as.typeddata.type->function.dfree;
internal.h
int rb_parse_in_main(void);
VALUE rb_insns_name_array(void);
/* cont.c */
VALUE rb_obj_is_fiber(VALUE);
void rb_fiber_reset_root_local_storage(VALUE);
/* debug.c */
PRINTF_ARGS(void ruby_debug_printf(const char*, ...), 1, 2);
vm.c
rb_gc_force_recycle(vm->self);
vm->main_thread = 0;
if (th) {
rb_fiber_reset_root_local_storage(th->self);
thread_free(th);
}
if (vm->living_threads) {
(4-4/4)