Parallel and high-performance computing

Two threads need locks L1 and L2. One path acquires L1 then L2, while another acquires L2 then L1. Which change most directly prevents deadlock from this lock-order cycle?