summaryrefslogtreecommitdiffstats
path: root/server/mpm/worker
diff options
context:
space:
mode:
authorChris Darroch <chrisd@apache.org>2008-03-04 21:03:51 +0100
committerChris Darroch <chrisd@apache.org>2008-03-04 21:03:51 +0100
commit46ccf01ae7e1caadf26818afe2c212c9ccc8938d (patch)
treedd7a34a3ec7a066b7852eda067a4efd9bb235476 /server/mpm/worker
parentEnable UAC transition from ApacheMonitor running as a vanilla user without priv (diff)
downloadapache2-46ccf01ae7e1caadf26818afe2c212c9ccc8938d.tar.xz
apache2-46ccf01ae7e1caadf26818afe2c212c9ccc8938d.zip
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
Diffstat (limited to 'server/mpm/worker')
-rw-r--r--server/mpm/worker/fdqueue.c8
1 files changed, 8 insertions, 0 deletions
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) {