[nginx] Thread pools: silence warning on process exit.

Ruslan Ermilov ru at nginx.com
Thu Mar 19 20:22:06 UTC 2015


details:   http://hg.nginx.org/nginx/rev/67717d4e4f47
branches:  
changeset: 6027:67717d4e4f47
user:      Ruslan Ermilov <ru at nginx.com>
date:      Thu Mar 19 23:20:18 2015 +0300
description:
Thread pools: silence warning on process exit.

Work around pthread_cond_destroy() and pthread_mutex_destroy() returning
EBUSY.  A proper solution would be to ensure all threads are terminated.

diffstat:

 src/core/ngx_thread_pool.c |  7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diffs (26 lines):

diff -r 25fda43e3bcb -r 67717d4e4f47 src/core/ngx_thread_pool.c
--- a/src/core/ngx_thread_pool.c	Thu Mar 19 13:00:48 2015 +0300
+++ b/src/core/ngx_thread_pool.c	Thu Mar 19 23:20:18 2015 +0300
@@ -172,7 +172,11 @@ ngx_thread_pool_queue_init(ngx_thread_po
 static ngx_int_t
 ngx_thread_pool_queue_destroy(ngx_thread_pool_queue_t *queue, ngx_log_t *log)
 {
+#if 0
     return ngx_thread_mutex_destroy(&queue->mtx, log);
+#else
+    return NGX_OK;
+#endif
 }
 
 
@@ -181,7 +185,10 @@ ngx_thread_pool_destroy(ngx_thread_pool_
 {
     /* TODO: exit threads */
 
+#if 0
     (void) ngx_thread_cond_destroy(&tp->cond, tp->log);
+#endif
+
     (void) ngx_thread_pool_queue_destroy(&tp->queue, tp->log);
 }
 



More information about the nginx-devel mailing list