Exemplo n.º 1
0
static VALUE
rb_thread_kill(VALUE thread, SEL sel)
{
    rb_vm_thread_t *t = GetThreadPtr(thread);
    rb_vm_thread_t *t_main = GetThreadPtr(rb_vm_main_thread()); 
    if (t->thread == t_main->thread) { 
	rb_exit(EXIT_SUCCESS); 
    } 
    if (t->status != THREAD_KILLED) {
	rb_vm_thread_cancel(t);
    }
    return thread;
}
Exemplo n.º 2
0
static VALUE
rb_thread_s_main(VALUE klass, SEL sel)
{
    return rb_vm_main_thread();
}