`apos` is the next position that will be reserved by `alloc_buffer_cb` and `wpos` is the next position that will be "written"(the actual copying is done by libuv) by `read_cb`.

I agree that it's not currently necessary. Seeing how the IO lock is acquired in the `alloc_buffer_cb` and only released after `wpos` is updated in `read_cb`, it's not possible that the main thread will read up to `wpos` before libuv has a chance to copy the data into the buffer.

I need to rethink this to deal with two consecutive calls to `alloc_cb` by libuv.