mpm_fdqueue: return EOF for ap_queue_interrupt_*() when terminated.

* server/mpm_fdqueue.c (queue_interrupt): noop and return APR_EOF when queue is
  terminated already.

* server/mpm_fdqueue.h (struct fd_queue_t): make "terminated" volatile.

Follow up to r1891716.
Github: closes #208


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1891724 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Yann Ylavic
2021-07-22 15:48:03 +00:00
parent 70d7c7b009
commit cb17448b56
2 changed files with 5 additions and 1 deletions

View File

@ -493,6 +493,10 @@ static apr_status_t queue_interrupt(fd_queue_t *queue, int all, int term)
{
apr_status_t rv;
if (queue->terminated) {
return APR_EOF;
}
if ((rv = apr_thread_mutex_lock(queue->one_big_mutex)) != APR_SUCCESS) {
return rv;
}

View File

@ -83,7 +83,7 @@ struct fd_queue_t
unsigned int out;
apr_thread_mutex_t *one_big_mutex;
apr_thread_cond_t *not_empty;
int terminated;
volatile int terminated;
};
typedef struct fd_queue_t fd_queue_t;