Puoi provare a richiamare la funzione da due thread diversi.
Amaro C++, il gusto pieno dell'undefined behavior.
Regole del Forum