ruby 线程学习

i=1
Thread.start{
    while true
        print "Thread 1 
"
        i+=1
        if i==5 then
            Thread.kill Thread.current
        end
    end
}
j=1
while true
    print "Thread 2 
"
    j+=1
    if j==4 then
        Thread.exit
    end
end
原文地址:https://www.cnblogs.com/wangwenfei/p/ruby_thread.html