Merge pull request #5298 from cgundogan/pr/cib/cib_get_check_fix
cib: check (write > read) explicitly
This commit is contained in:
commit
15130e8674
@ -79,9 +79,7 @@ static inline unsigned int cib_avail(cib_t *__restrict cib)
|
|||||||
*/
|
*/
|
||||||
static inline int cib_get(cib_t *__restrict cib)
|
static inline int cib_get(cib_t *__restrict cib)
|
||||||
{
|
{
|
||||||
unsigned int avail = cib_avail(cib);
|
if (cib->write_count > cib->read_count) {
|
||||||
|
|
||||||
if (avail > 0) {
|
|
||||||
return (int) (cib->read_count++ & cib->mask);
|
return (int) (cib->read_count++ & cib->mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user