The @resource condition variable is waited on in a block depending on the same mutex that is used to notify the condition variable.
Unless I'm mistaken, if that condition variable ever gets waited on, this means it'll block every thread for the full timeout, including the threads returning connections to the pool, which could have notified the waiting thread instead.
The
@resource
condition variable is waited on in a block depending on the same mutex that is used to notify the condition variable.Unless I'm mistaken, if that condition variable ever gets waited on, this means it'll block every thread for the full timeout, including the threads returning connections to the pool, which could have notified the waiting thread instead.
https://github.com/mperham/connection_pool/blob/master/lib/connection_pool/timed_stack.rb#L87