Mark packet-stream descriptor head/tail as volatile

`volatile` effectively prevents instruction reordering by the compiler
and fixes an issue with -O3 compiled components.

Note, this commit does not address further arguments regarding memory
barriers and volatile voiced in issue #693.

Issue #693
This commit is contained in:
Christian Helmuth 2019-12-20 14:34:22 +01:00
parent 8d63a3c1f3
commit 9a35743df6
1 changed files with 2 additions and 2 deletions

View File

@ -168,8 +168,8 @@ class Genode::Packet_descriptor_queue
*/
struct
{
unsigned _head;
unsigned _tail;
unsigned volatile _head;
unsigned volatile _tail;
PACKET_DESCRIPTOR _queue[QUEUE_SIZE];
};