lock

ReentrantReadWriteLock guarding mutual exclusion of the pool.

This lock is required to ensure that the pool is not recreated while a thread is attempting to obtain a connection from the pool. In this case, ReentrantReadWriteLock.read is used for obtaining the pool state and acquiring a connection from the pool, whereas ReentrantReadWriteLock.write is used for performing structural changes to the pool (e.g. pool recreation).