implementing pool lock