]> granicus.if.org Git - apache/commitdiff
add comment from event MPM's fdqueue ap_pop_pool() regarding
authorChris Darroch <chrisd@apache.org>
Tue, 4 Mar 2008 20:03:51 +0000 (20:03 +0000)
committerChris Darroch <chrisd@apache.org>
Tue, 4 Mar 2008 20:03:51 +0000 (20:03 +0000)
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

server/mpm/worker/fdqueue.c

index 8a75d24d1eddcd79f1c5118fcb3c037d0075d011..d46dd5361bd765a8a1e0b80287e6605579ca1b4c 100644 (file)
@@ -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) {