block query until the lock is released