diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:56 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-10-17 22:42:56 -0700 |
commit | a764983fccd6cce64043d76e09a5e1718e7f8fd6 (patch) | |
tree | cd6f730c5b93c584a7cdda57079b318d99bb3120 /lib/rainbows/thread_spawn.rb | |
parent | 71a1cf90ce16ce6951f1ce76fcea98b13bc54576 (diff) | |
download | rainbows-a764983fccd6cce64043d76e09a5e1718e7f8fd6.tar.gz |
We use the "G" global constant from the Rev model everywhere to simplify things a little. Test cases are more consistent now, too.
Diffstat (limited to 'lib/rainbows/thread_spawn.rb')
-rw-r--r-- | lib/rainbows/thread_spawn.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index 104e764..39934a6 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -27,9 +27,10 @@ module Rainbows limit = worker_connections begin + G.alive && master_pid == Process.ppid or break ret = begin alive.chmod(m = 0 == m ? 1 : 0) - IO.select(LISTENERS, nil, nil, timeout) or next + IO.select(LISTENERS, nil, nil, 1) or next rescue Errno::EINTR retry rescue Errno::EBADF, TypeError @@ -55,7 +56,7 @@ module Rainbows end rescue Object => e listen_loop_error(e) - end while LISTENERS.first && master_pid == Process.ppid + end while true join_threads(threads.list, worker) end |