Project

General

Profile

Backport #5130 ยป thread_2.diff

normalperson (Eric Wong), 08/24/2011 09:31 AM

View differences:

thread.c
420 420
    native_thread_init_stack(th);
421 421
}
422 422

  
423
#ifdef USE_SIGALTSTACK
424
void rb_register_sigaltstack(rb_thread_t *th);
425
#else
426
#  define rb_register_sigaltstack(th) for(;0;)
427
#endif
428

  
423 429
static int
424 430
thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_start)
425 431
{
......
429 435
    rb_thread_t *join_th;
430 436
    rb_thread_t *main_th;
431 437
    VALUE errinfo = Qnil;
432
# ifdef USE_SIGALTSTACK
433
    void rb_register_sigaltstack(rb_thread_t *th);
438

  
439
    if (GET_VM()->inhibit_thread_creation) {
440
	thread_debug("not starting thread due to interpreter shutdown: %p\n", (void *)th);
441
	thread_cleanup_func(th, FALSE);
442
	st_delete_wrap(th->vm->living_threads, th->self);
443
	return 1;
444
    }
434 445

  
435 446
    rb_register_sigaltstack(th);
436
# endif
437 447

  
438 448
    ruby_thread_set_native(th);
439 449