… | |
… | |
299 | { |
299 | { |
300 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
300 | linuxaio_parse_events (EV_A_ ring->io_events + head, ring->nr - head); |
301 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
301 | linuxaio_parse_events (EV_A_ ring->io_events, tail); |
302 | } |
302 | } |
303 | |
303 | |
304 | /* TODO: we only need a compiler barrier here, not a read fence */ |
|
|
305 | ECB_MEMORY_FENCE_RELEASE; |
304 | ECB_MEMORY_FENCE_RELAXED; |
306 | /* as an extension to C, we hope that the volatile will make this atomic and once-only */ |
305 | /* as an extension to C, we hope that the volatile will make this atomic and once-only */ |
307 | *(volatile unsigned *)&ring->head = tail; |
306 | *(volatile unsigned *)&ring->head = tail; |
308 | /* make sure kernel can see our new head value - probably not required */ |
307 | /* make sure kernel can see our new head value - probably not required */ |
309 | ECB_MEMORY_FENCE_RELEASE; |
308 | ECB_MEMORY_FENCE_RELEASE; |
310 | |
309 | |