Mercurial > hg > nginx
comparison src/core/ngx_thread_pool.c @ 6027:67717d4e4f47
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.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Thu, 19 Mar 2015 23:20:18 +0300 |
parents | 25fda43e3bcb |
children | fc36690e7f44 |
comparison
equal
deleted
inserted
replaced
6026:25fda43e3bcb | 6027:67717d4e4f47 |
---|---|
170 | 170 |
171 | 171 |
172 static ngx_int_t | 172 static ngx_int_t |
173 ngx_thread_pool_queue_destroy(ngx_thread_pool_queue_t *queue, ngx_log_t *log) | 173 ngx_thread_pool_queue_destroy(ngx_thread_pool_queue_t *queue, ngx_log_t *log) |
174 { | 174 { |
175 #if 0 | |
175 return ngx_thread_mutex_destroy(&queue->mtx, log); | 176 return ngx_thread_mutex_destroy(&queue->mtx, log); |
177 #else | |
178 return NGX_OK; | |
179 #endif | |
176 } | 180 } |
177 | 181 |
178 | 182 |
179 static void | 183 static void |
180 ngx_thread_pool_destroy(ngx_thread_pool_t *tp) | 184 ngx_thread_pool_destroy(ngx_thread_pool_t *tp) |
181 { | 185 { |
182 /* TODO: exit threads */ | 186 /* TODO: exit threads */ |
183 | 187 |
188 #if 0 | |
184 (void) ngx_thread_cond_destroy(&tp->cond, tp->log); | 189 (void) ngx_thread_cond_destroy(&tp->cond, tp->log); |
190 #endif | |
191 | |
185 (void) ngx_thread_pool_queue_destroy(&tp->queue, tp->log); | 192 (void) ngx_thread_pool_queue_destroy(&tp->queue, tp->log); |
186 } | 193 } |
187 | 194 |
188 | 195 |
189 ngx_thread_task_t * | 196 ngx_thread_task_t * |