From a027f984ce151863e25fb72b3b27a55c56fa068e Mon Sep 17 00:00:00 2001 From: matz Date: Mon, 25 Sep 2000 09:15:08 +0000 Subject: matz git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/thwait.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/thwait.rb b/lib/thwait.rb index 3c1700931..00c8a8dd3 100644 --- a/lib/thwait.rb +++ b/lib/thwait.rb @@ -44,13 +44,12 @@ class ThreadsWait Exception2MessageMapper.extend_to(binding) def_exception("ErrNoWaitingThread", "No threads for waiting.") - def_exception("ErrNoFinshedThread", "No finished threads.") + def_exception("ErrNoFinishedThread", "No finished threads.") def ThreadsWait.all_waits(*threads) tw = ThreadsWait.new(*threads) if block_given? - tw.all_waits do - |th| + tw.all_waits do |th| yield th end else @@ -96,11 +95,12 @@ class ThreadsWait # adds thread(s) to join, no wait. def join_nowait(*threads) - @threads.concat threads.flatten + threads.flatten! + @threads.concat threads for th in threads - Thread.start do - th = th.join - @wait_queue.push th + Thread.start(th) do |t| + t.join + @wait_queue.push t end end end -- cgit