… | |
… | |
334 | { |
334 | { |
335 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
335 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
336 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
336 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
337 | } |
337 | } |
338 | |
338 | |
339 | ECB_MEMORY_FENCE_RELAXED; |
339 | ECB_MEMORY_FENCE_RELEASE; |
340 | /* as an extension to C, we hope that the volatile will make this atomic and once-only */ |
340 | /* as an extension to C, we hope that the volatile will make this atomic and once-only */ |
341 | *(volatile unsigned *)&ring->head = tail; |
341 | *(volatile unsigned *)&ring->head = tail; |
342 | /* make sure kernel can see our new head value - probably not required */ |
342 | /* make sure kernel can see our new head value - probably not required */ |
343 | ECB_MEMORY_FENCE_RELEASE; |
|
|
344 | |
343 | |
345 | return 1; |
344 | return 1; |
346 | } |
345 | } |
347 | |
346 | |
348 | /* read at least one event from kernel, or timeout */ |
347 | /* read at least one event from kernel, or timeout */ |