Here you want to do
```
bool expected = false;
if(iFailedAlready.compare_exchange_strong(expected,true,std::memory_order_acq_rel) ) {
```
and then get rid of the ```iFailedAlready=true```. That code change will guarantee that the printout will happen once and only once.