Skip to content

Commit e8c4b72

Browse files
committed
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/branches/2.2.x@634050 13f79535-47bb-0310-9956-ffa450edef68
1 parent 945d8b5 commit e8c4b72

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

server/mpm/worker/fdqueue.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info,
188188
apr_atomic_dec32(&(queue_info->idlers));
189189

190190
/* Atomically pop a pool from the recycled list */
191+
192+
/* This function is safe only as long as it is single threaded because
193+
* it reaches into the queue and accesses "next" which can change.
194+
* We are OK today because it is only called from the listener thread.
195+
* cas-based pushes do not have the same limitation - any number can
196+
* happen concurrently with a single cas-based pop.
197+
*/
198+
191199
for (;;) {
192200
struct recycled_pool *first_pool = queue_info->recycled_pools;
193201
if (first_pool == NULL) {

0 commit comments

Comments
 (0)