--- orghttpd-2.2.8/server/mpm/worker/fdqueue.c Wed Jul 25 06:13:49 2007 +++ httpd-2.2.8/server/mpm/worker/fdqueue.c Fri Feb 22 11:38:17 2008 @@ -94,10 +94,14 @@ sizeof(*new_recycle)); new_recycle->pool = pool_to_recycle; for (;;) { - new_recycle->next = queue_info->recycled_pools; + /* Save the queue_info->recycled_pool->next in local variable next + * because new_recycle->next can be changed after call of + * apr_atomic_casptr. + */ + struct recycled_pool *next = queue_info->recycled_pools; + new_recycle->next = next; if (apr_atomic_casptr((volatile void**)&(queue_info->recycled_pools), - new_recycle, new_recycle->next) == - new_recycle->next) { + new_recycle, new_recycle->next) == next) { break; } }