Skip to content

Commit d6bdcaf

Browse files
committed
2.0.1
added 'volatile' to the head and tail indexes into the ring buffer
1 parent 52c53d7 commit d6bdcaf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/ring_buf.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @brief Lock-free ring buffer
44
*/
55
/*****************************************************************************
6-
* Last updated on 2022-02-21
6+
* Last updated on 2022-02-22
77
*
88
* Q u a n t u m L e a P s
99
* ------------------------
@@ -61,8 +61,8 @@ typedef uint8_t RingBufElement;
6161
typedef struct {
6262
RingBufElement *buf; /*!< pointer to the start of the ring buffer */
6363
RingBufCtr end; /*!< offset of the end of the ring buffer */
64-
RingBufCtr head; /*!< offset to where next byte will be inserted */
65-
RingBufCtr tail; /*!< offset of where next byte will be extracted */
64+
RingBufCtr volatile head; /*!< offset to where next el. will be inserted */
65+
RingBufCtr volatile tail; /*!< offset of where next el. will be extracted */
6666
} RingBuf;
6767

6868
typedef void (*RingBufHandler)(RingBufElement const el);

0 commit comments

Comments
 (0)