diff options
author | Eric Wong <normalperson@yhbt.net> | 2010-09-28 17:40:01 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2010-09-28 17:40:01 -0700 |
commit | ad821f70a2488a91f2be1ac53cb2e64f50743989 (patch) | |
tree | 6db4d334106360305ba3b66b643e8694f232fa10 /lib/rainbows/thread_spawn.rb | |
parent | 11c75ec06ce72cea0c760161dc01a196500aa293 (diff) | |
download | rainbows-ad821f70a2488a91f2be1ac53cb2e64f50743989.tar.gz |
It removes the burden of byte slicing and setting file descriptor flags. In some cases, we can remove unnecessary peeraddr calls, too.
Diffstat (limited to 'lib/rainbows/thread_spawn.rb')
-rw-r--r-- | lib/rainbows/thread_spawn.rb | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/rainbows/thread_spawn.rb b/lib/rainbows/thread_spawn.rb index 0d4973a..a0ccde6 100644 --- a/lib/rainbows/thread_spawn.rb +++ b/lib/rainbows/thread_spawn.rb @@ -18,7 +18,6 @@ module Rainbows module ThreadSpawn include Base - include Rainbows::Acceptor def accept_loop(klass) #:nodoc: lock = Mutex.new @@ -37,7 +36,7 @@ module Rainbows # CPU during I/O wait, CPU cycles that can be better used # by other worker _processes_. sleep(0.01) - elsif c = sync_accept(l) + elsif c = l.kgio_accept klass.new(c) do |c| begin lock.synchronize { G.cur += 1 } |