]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add comments that make it clear that we are using
authorJim Jagielski <jim@apache.org>
Tue, 7 Aug 2007 12:22:19 +0000 (12:22 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 7 Aug 2007 12:22:19 +0000 (12:22 +0000)
the 32bit add/inc atomics in an "unsure" method (although
I would assume if they were NOT working, then the various
testing and usage of event for trunk and 2.2.x would have shown
this by now).

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@563470 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/experimental/event/fdqueue.c

index 0018669808478ff8e78ebbb3934818095e93289f..8534a3e8de21ac8c17d46a069c7c4e13bfdb738c 100644 (file)
@@ -95,6 +95,11 @@ apr_status_t ap_queue_info_set_idle(fd_queue_info_t * queue_info,
     ap_push_pool(queue_info, pool_to_recycle);
 
     /* Atomically increment the count of idle workers */
+    /*
+     * TODO: The atomics expect unsigned whereas we're using signed.
+     *       Need to double check that they work as expected or else
+     *       rework how we determine blocked.
+     */
     prev_idlers = apr_atomic_inc32((apr_uint32_t *)&(queue_info->idlers));
 
     /* If other threads are waiting on a worker, wake one up */
@@ -124,6 +129,7 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t * queue_info)
     int prev_idlers;
 
     /* Atomically decrement the idle worker count, saving the old value */
+    /* See TODO in ap_queue_info_set_idle() */
     prev_idlers = apr_atomic_add32((apr_uint32_t *)&(queue_info->idlers), -1);
 
     /* Block if there weren't any idle workers */
@@ -131,6 +137,7 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t * queue_info)
         rv = apr_thread_mutex_lock(queue_info->idlers_mutex);
         if (rv != APR_SUCCESS) {
             AP_DEBUG_ASSERT(0);
+            /* See TODO in ap_queue_info_set_idle() */
             apr_atomic_inc32((apr_uint32_t *)&(queue_info->idlers));    /* back out dec */
             return rv;
         }