new file:   test_and_set
ref: http://en.wikipedia.org/wiki/Test-and-set