cpp/atomic/atomic flag/test and set

Atomically changes the state of a std to set and returns the value it held before.