summaryrefslogtreecommitdiff
path: root/src/bio.c
diff options
context:
space:
mode:
authorDave-in-lafayette <64047859+Dave-in-lafayette@users.noreply.github.com>2020-04-20 16:38:06 -0700
committerGitHub <noreply@github.com>2020-04-20 16:38:06 -0700
commit80b6f9b0cb46666a14d471248cc3747930a28dd4 (patch)
treeb56d612414269beba8ca4b16b5d3526aab3afee5 /src/bio.c
parentc49fb47fbe0086dc9e44b8ac39128beb7ec1bf3a (diff)
downloadredis-80b6f9b0cb46666a14d471248cc3747930a28dd4.tar.gz
fix for crash during panic before all threads are up
If there's a panic before all threads have been started (say, if file descriptor 0 is closed at exec), the panic response will crash here again.
Diffstat (limited to 'src/bio.c')
-rw-r--r--src/bio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bio.c b/src/bio.c
index 0662c8c4c..85f681185 100644
--- a/src/bio.c
+++ b/src/bio.c
@@ -266,7 +266,7 @@ void bioKillThreads(void) {
int err, 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) {
serverLog(LL_WARNING,
"Bio thread for job type #%d can be joined: %s",