If I have something like this...
volatile long something_global = 0;
long some_public_func()
{
return something_global++;
}
Would it be reasonable to expect this code to not break (race condition) when accessed with multiple threads? If it's not standard, could it still be done as a reasonable assumption about modern compilers?
NOTE: ALL I'm using this for is atomic increment and decrement - nothing fancier.