ruby-concurrency/concurrent-ruby — pull request #108 by billdueber (2014-06-10 03:07:13+00:00)
Title: Isolated MRI threadpool fix

OK. The problem in issue #106 remains, but my pull request in #107 bit off way more than I could chew.

This is a smaller change set, based on the following:

* 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.
* `TimerSet#kill` (which was just an alias to `#shutdown` was relying on the incorrect `@queue.clear` in `shutdown`, resulting in a failed spec after the above fix. I rewrote `#kill` to explicitly clear the queue before calling `#shutdown`.