apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: svn commit: r1797422 - /apr/apr/trunk/memcache/apr_memcache.c
Date Mon, 05 Jun 2017 20:43:43 GMT
On Mon, Jun 5, 2017 at 4:32 PM, William A Rowe Jr <wrowe@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.

>>      pollfds = apr_pcalloc(temp_pool, apr_hash_count(server_queries) *
>> sizeof(apr_pollfd_t));
>>
>> -    rv = apr_pollset_create(&pollset, apr_hash_count(server_queries),
>> temp_pool, 0);
>> +    rv = apr_pollset_create(&pollset, apr_hash_count(server_queries),
>> temp_pool,
>> +                            APR_POLLSET_NOCOPY);

Looks kosher, the pollfds that will be added to this pollset have the
same lifetime / same pool (beginning of the diff context), and the
pollset does not escape this function.

Mime
View raw message