Mercurial > hg > nginx
comparison src/core/ngx_thread_pool.c @ 6667:33d075b9097d
Thread pools: create threads in detached state.
This prevents theoretical resource leak, since those threads are never joined.
Found with ThreadSanitizer.
Signed-off-by: Piotr Sikora <piotrsikora@google.com>
author | Piotr Sikora <piotrsikora@google.com> |
---|---|
date | Mon, 15 Aug 2016 05:52:04 -0700 |
parents | 657e029bac28 |
children |
comparison
equal
deleted
inserted
replaced
6666:3f82c1e7e29e | 6667:33d075b9097d |
---|---|
135 ngx_log_error(NGX_LOG_ALERT, log, err, | 135 ngx_log_error(NGX_LOG_ALERT, log, err, |
136 "pthread_attr_init() failed"); | 136 "pthread_attr_init() failed"); |
137 return NGX_ERROR; | 137 return NGX_ERROR; |
138 } | 138 } |
139 | 139 |
140 err = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); | |
141 if (err) { | |
142 ngx_log_error(NGX_LOG_ALERT, log, err, | |
143 "pthread_attr_setdetachstate() failed"); | |
144 return NGX_ERROR; | |
145 } | |
146 | |
140 #if 0 | 147 #if 0 |
141 err = pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); | 148 err = pthread_attr_setstacksize(&attr, PTHREAD_STACK_MIN); |
142 if (err) { | 149 if (err) { |
143 ngx_log_error(NGX_LOG_ALERT, log, err, | 150 ngx_log_error(NGX_LOG_ALERT, log, err, |
144 "pthread_attr_setstacksize() failed"); | 151 "pthread_attr_setstacksize() failed"); |