This implements a generic thread-safe resource pool. This pool can acquire, release, add or remove resources simultaneously.