… | |
… | |
334 | |
334 | |
335 | if (head == tail) |
335 | if (head == tail) |
336 | return 0; |
336 | return 0; |
337 | |
337 | |
338 | /* parse all available events, but only once, to avoid starvation */ |
338 | /* parse all available events, but only once, to avoid starvation */ |
339 | if (tail > head) /* normal case around */ |
339 | if (ecb_expect_true (tail > head)) /* normal case around */ |
340 | linuxaio_parse_events (EV_A_ ring->io_events + head, tail - head); |
340 | linuxaio_parse_events (EV_A_ ring->io_events + head, tail - head); |
341 | else /* wrapped around */ |
341 | else /* wrapped around */ |
342 | { |
342 | { |
343 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
343 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
344 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
344 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |