Bug 964023 - improve re-entrancy of locks; r=telliott