I wrote that here no volatile is needed, because in this code the flag is read only once. There is nothing wrong with this pattern.
If somebody thinks that volatile should be mentioned, he should also mention atomic access, IMO.
I wrote that here no volatile is needed, because in this code the flag is read only once. There is nothing wrong with this pattern.
If somebody thinks that volatile should be mentioned, he should also mention atomic access, IMO.