标签: ruby
基本上我想知道Thread.new创建的线程何时退出并在此之后添加一行。我该怎么做?
Thread.new
答案 0 :(得分:0)
您可以使用Thread.join来阻止,直到线程终止:
Thread.join
thread = Thread.new # Obviously called with necessary arguments thread.join puts "Thread has terminated"