Open relascope opened 1 year ago
C++98 does not have std::atomic, which DPF still targets as minimum requirement.
I do not want to introduce new C++ requirements until very strictly necessary. The volatile there is meant more as an indication that it should never be optimized away, as a precaution more than reassurance.
AFAIK the C++ keyword
volatile
has to do with compiler optimization (especially ordering). (it was a little different in C)std::atomic
guarantees "undefined behaviour"-free code, when multiple threads access astd::atomic<trivialtype>
variable concurrently like it is possible in Thread through internal running Thread and concurrent other threads through the publicThread::signalThreadShouldExit
.