diff options
author | Aaron Bannert <aaron@apache.org> | 2002-04-29 00:32:17 +0200 |
---|---|---|
committer | Aaron Bannert <aaron@apache.org> | 2002-04-29 00:32:17 +0200 |
commit | 464b62610a6d571c7477a7c2e1b458290c57316c (patch) | |
tree | be45bd4fbc5b48a70c7d88dc1b00809b5d3de835 /server/mpm | |
parent | Some threadpool fixes: (diff) | |
download | apache2-464b62610a6d571c7477a7c2e1b458290c57316c.tar.xz apache2-464b62610a6d571c7477a7c2e1b458290c57316c.zip |
Clarify an incorrect statement about why we're purposfully putting
the signal inside of a mutex.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94842 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r-- | server/mpm/experimental/threadpool/threadpool.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/server/mpm/experimental/threadpool/threadpool.c b/server/mpm/experimental/threadpool/threadpool.c index 33f4a17ad4..ac63d901d1 100644 --- a/server/mpm/experimental/threadpool/threadpool.c +++ b/server/mpm/experimental/threadpool/threadpool.c @@ -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); } |