Updated acquire and release lock