cycling deque lock before checking capacity