Fehler #666
Von Maximilian Seesslen vor etwa 10 Stunden aktualisiert
Atomic access is required:
__atomic_add_fetch (&i1, 1, __ATOMIC_ACQ_REL);
The attached example can be used as unit test. A thread is filling the buffer, another thread is reading, data should be continuous.
__atomic_add_fetch (&i1, 1, __ATOMIC_ACQ_REL);
The attached example can be used as unit test. A thread is filling the buffer, another thread is reading, data should be continuous.