On Mon, Jun 5, 2017 at 10:32 PM, William A Rowe Jr <wr...@rowe-clan.net> wrote: > What happens if two different threads attempt this poll in parallel? I > presumed pollsets are copied to prevent two threads from clashing.
APR_POLLSET_NOCOPY is about the lifetime of the pollfds, while thread-safety should be ensured by APR_POLLSET_THREADSAFE (using no/zero flags as before was actually not thread-safe already). BTW, if the OS/native pollset is already threadsafe and APR_POLLSET_NOCOPY is specified, APR_POLLSET_THREADSAFE can sometimes be omitted/ignored (this the case for e.g. epoll, but not for kqueue whereas it possibly could be). Hence if we really need to be thread-safe here we should use APR_POLLSET_THREADSAFE explicitely.