Use with statement for pool lock acquisition