kill(p1)
public
Causes the given thread to exit, see also Thread::exit.
count = 0
a = Thread.new { loop { count += 1 } }
sleep(0.1)
Thread.kill(a)
count
a.alive?
Show source
static VALUE
rb_thread_s_kill(VALUE obj, VALUE th)
{
return rb_thread_kill(th);
}