1. A method comprising: accessing a shared memory associated with a reader-writer lock according to a first concurrency mode during execution of a first thread of a transaction in a software transactional memory (STM) system; determining if a value of the reader-writer lock has changed at commitment of the first thread; and if so, updating a count of a number of changed lock values for one of a set of locks, and re-executing the first thread of the transaction if the count is less than a threshold.