meh/ruby-thread — pull request #7 by Kris-LIBIS (2013-06-27 22:13:45+00:00)
Title: Features: wait for consumed tasks and idle trimming

Two features are added:

* Wait for consumed tasks will block the caller and unblock when all tasks are done and all workers are waiting. The new method is `Pool#wait_done`. A new `ConditionVariable` and `Mutex` were added for this feature. `Pool#done?` is an instant check for polling clients.

* Idle trimming can be enabled by supplying a timeout value (in number of seconds) to `Pool#idle_trim!`. When a worker thread is idle for `timeout` seconds it will remove itself from the pool until the minimum number of threads is reached.

Also fixed a type in `Pool#trim`.

This should fix #6.