Boats heading in the opposite direction can enter the lock when the gates are open. Then the process reverses itself.