Merge pull request #7121 from Dave-in-lafayette/patch-2

fix for crash during panic before all threads are up
This commit is contained in:
Salvatore Sanfilippo 2020-04-23 16:29:00 +02:00 committed by GitHub
commit 25725957e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -266,7 +266,7 @@ void bioKillThreads(void) {
int err, j; int err, j;
for (j = 0; j < BIO_NUM_OPS; j++) { for (j = 0; j < BIO_NUM_OPS; j++) {
if (pthread_cancel(bio_threads[j]) == 0) { if (bio_threads[j] && pthread_cancel(bio_threads[j]) == 0) {
if ((err = pthread_join(bio_threads[j],NULL)) != 0) { if ((err = pthread_join(bio_threads[j],NULL)) != 0) {
serverLog(LL_WARNING, serverLog(LL_WARNING,
"Bio thread for job type #%d can be joined: %s", "Bio thread for job type #%d can be joined: %s",