3440. [performance] Implement adaptive read-write locks, reducing the overhead of locks that are only held briefly. [RT #37329]