From: Chris Darroch Date: Tue, 4 Mar 2008 20:03:51 +0000 (+0000) Subject: add comment from event MPM's fdqueue ap_pop_pool() regarding X-Git-Tag: 2.3.0~908 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=46ccf01ae7e1caadf26818afe2c212c9ccc8938d;p=apache add comment from event MPM's fdqueue ap_pop_pool() regarding ABA problem and avoidance because only caller is single listener thread git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633612 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/worker/fdqueue.c b/server/mpm/worker/fdqueue.c index 8a75d24d1e..d46dd5361b 100644 --- a/server/mpm/worker/fdqueue.c +++ b/server/mpm/worker/fdqueue.c @@ -188,6 +188,14 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info, apr_atomic_dec32(&(queue_info->idlers)); /* Atomically pop a pool from the recycled list */ + + /* This function is safe only as long as it is single threaded because + * it reaches into the queue and accesses "next" which can change. + * We are OK today because it is only called from the listener thread. + * cas-based pushes do not have the same limitation - any number can + * happen concurrently with a single cas-based pop. + */ + for (;;) { struct recycled_pool *first_pool = queue_info->recycled_pools; if (first_pool == NULL) {