X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/7c748c061ecb630f52d0041c5d2497783aac5c06..f1466e11cd1c2c41f01e505e54f465d0eb4b4f42:/src/bio.c?ds=sidebyside diff --git a/src/bio.c b/src/bio.c index eaac8e40..aa2cdf9f 100644 --- a/src/bio.c +++ b/src/bio.c @@ -108,9 +108,18 @@ void bioCreateBackgroundJob(int type, void *arg1, void *arg2, void *arg3) { void *bioProcessBackgroundJobs(void *arg) { struct bio_job *job; unsigned long type = (unsigned long) arg; + sigset_t sigset; pthread_detach(pthread_self()); pthread_mutex_lock(&bio_mutex[type]); + /* Block SIGALRM so we are sure that only the main thread will + * receive the watchdog signal. */ + sigemptyset(&sigset); + sigaddset(&sigset, SIGALRM); + if (pthread_sigmask(SIG_BLOCK, &sigset, NULL)) + redisLog(REDIS_WARNING, + "Warning: can't mask SIGALRM in bio.c thread: %s", strerror(errno)); + while(1) { listNode *ln;