xepoll_thread_spawn: rework acceptor logic
commit07a0bee9dd6f2c366d11284b7e9ab09d66b411e4
authorEric Wong <normalperson@yhbt.net>
Sun, 8 May 2011 04:06:12 +0000 (8 04:06 +0000)
committerEric Wong <normalperson@yhbt.net>
Sun, 8 May 2011 05:24:23 +0000 (8 05:24 +0000)
tree00c20d3199c2bb36d643b021d3789bd19f89b979
parentc543b295ff2108623f3748a141e04e5530d06377
xepoll_thread_spawn: rework acceptor logic

Infinite sleep is too dangerous due to possible race conditions,
so use worker_yield which is safer and cheaper in the general
case.  We can also avoid sleeping on new threads by only
spawning when the client module is included.
lib/rainbows/xepoll_thread_spawn/client.rb