1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-09-25 09:15:08 +00:00
parent 40412b7730
commit b9228a014b
7 changed files with 50 additions and 32 deletions

View file

@ -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