race_test
The module allows automated testing of race conditions in a real world race scenario. It is for tests only.
This helper will re-run the command line it started with so it's recommended to test a single class only.
It synchronizes the parent and the child at a point of your choosing, makes the parent wait a little to ensure the child wins the race and then lets the parent continue making a test fail.
Currently a lock acquire or running a SELECT query is supported as sync points. To specify which one, the lock name / SELECT query can be matched against a PCRE pattern and an optional count can be specified too so the Nth match will be the sync point.
Currently only kernel tests have been tested but the main mechanism is ready for anything. Also, currently only Linux is supported, Mac OS X would be relatively easy to add.