What happens if two different threads attempt this poll in parallel? I
presumed pollsets are copied to prevent two threads from clashing.


On Jun 2, 2017 14:58, <jaillet...@apache.org> wrote:

> Author: jailletc36
> Date: Fri Jun  2 19:58:55 2017
> New Revision: 1797422
>
> URL: http://svn.apache.org/viewvc?rev=1797422&view=rev
> Log:
> Save some cycles by not copying the pollfds.
>
> Modified:
>     apr/apr/trunk/memcache/apr_memcache.c
>
> Modified: apr/apr/trunk/memcache/apr_memcache.c
> URL: http://svn.apache.org/viewvc/apr/apr/trunk/memcache/apr_
> memcache.c?rev=1797422&r1=1797421&r2=1797422&view=diff
> ============================================================
> ==================
> --- apr/apr/trunk/memcache/apr_memcache.c (original)
> +++ apr/apr/trunk/memcache/apr_memcache.c Fri Jun  2 19:58:55 2017
> @@ -1296,7 +1296,8 @@ apr_memcache_multgetp(apr_memcache_t *mc
>      /* create polling structures */
>      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);
>
>      if (rv != APR_SUCCESS) {
>          query_hash_index = apr_hash_first(temp_pool, server_queries);
>
>
>

Reply via email to