Feature #1791: Avoid deadlock