]> granicus.if.org Git - apache/commitdiff
Clarify an incorrect statement about why we're purposfully putting
authorAaron Bannert <aaron@apache.org>
Sun, 28 Apr 2002 22:32:17 +0000 (22:32 +0000)
committerAaron Bannert <aaron@apache.org>
Sun, 28 Apr 2002 22:32:17 +0000 (22:32 +0000)
the signal inside of a mutex.

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

server/mpm/experimental/threadpool/threadpool.c

index 33f4a17ad4d0b3b6fc14a2f2c892ae3d387225b7..ac63d901d10c13fc40e761c62dc1d52ba9dd97b4 100644 (file)
@@ -952,8 +952,11 @@ static void *listener_thread(apr_thread_t *thd, void * dummy)
                 /* Wake up the sleeping worker. */
                 apr_thread_mutex_lock(worker->mutex);
                 worker->csd = (apr_socket_t *)csd;
-                /* We must own the lock associated with the condition
-                 * variable that we are signaling. */
+                /* Posix allows us to signal this condition without
+                 * owning the associated mutex, but in that case it can
+                 * not guarantee predictable scheduling. See
+                 * _UNIX Network Programming: Interprocess Communication_
+                 * by W. Richard Stevens, Vol 2, 2nd Ed, pp. 170-171. */
                 apr_thread_cond_signal(worker->cond);
                 apr_thread_mutex_unlock(worker->mutex);
                 worker = NULL;
@@ -975,8 +978,11 @@ static void *listener_thread(apr_thread_t *thd, void * dummy)
     worker_stack_interrupt_all(idle_worker_stack);
     if (worker) {
         apr_thread_mutex_lock(worker->mutex);
-        /* We must own the lock associated with the condition
-         * variable that we are signaling. */
+        /* Posix allows us to signal this condition without
+         * owning the associated mutex, but in that case it can
+         * not guarantee predictable scheduling. See
+         * _UNIX Network Programming: Interprocess Communication_
+         * by W. Richard Stevens, Vol 2, 2nd Ed, pp. 170-171. */
         apr_thread_cond_signal(worker->cond);
         apr_thread_mutex_unlock(worker->mutex);
     }