]> git.kaiwu.me - nginx.git/commitdiff
Thread pools: silence warning on process exit.
authorRuslan Ermilov <ru@nginx.com>
Thu, 19 Mar 2015 20:20:18 +0000 (23:20 +0300)
committerRuslan Ermilov <ru@nginx.com>
Thu, 19 Mar 2015 20:20:18 +0000 (23:20 +0300)
Work around pthread_cond_destroy() and pthread_mutex_destroy() returning
EBUSY.  A proper solution would be to ensure all threads are terminated.

src/core/ngx_thread_pool.c

index d6e85202f1b73e84053afa90ed29deaeb8aac321..5bc6153e0197e5dfdbf0ef941aa38f0af71f581b 100644 (file)
@@ -172,7 +172,11 @@ ngx_thread_pool_queue_init(ngx_thread_pool_queue_t *queue, ngx_log_t *log)
 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_t *tp)
 {
     /* 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);
 }