ruby-concurrency/concurrent-ruby — pull request #107 by billdueber (2014-06-09 20:51:33+00:00)
Title: Threadpool fixes under MRI

I found an error (see #106) in the MRI threadpool implementation. It boils down to this:

* ` RubyThreadPoolExecutor#shutdown_execution` incorrectly clears the queue; it shoudn't.
* The specs that test `shutdown` use `sleep` to kill time, presumably to avoid interdependency between the specs for `shutdown` and `wait_for_timeout`
* ...but this means that the actual problem was masked, because the `sleep` calls allowed the threads to all finish (emptying the queue) before the shutdown (incorrectly) cleared the queue.
* In a related note, `Executor#wait_for_timeout` had different signatures in the Java and Ruby versions (the Ruby version defaulted to `nil` -- wait forever. The java version always required a number of seconds). Unified them so that the "wait forever" timeout (no value passed or a `nil` value passed) means "Wait a day" and passing in a zero ("don't wait at all") immediately returns `nil`

I've added a couple specs to test `shutdown` and `wait_for_timeout` in concert with each other with no calls to `sleep` to cover up any problems.