Check bio.c job type at thread startup.
Another one just to avoid a warning. Slightly more defensive code anyway.
This commit is contained in:
parent
221d2932b5
commit
34460dd6ee
@ -142,6 +142,13 @@ void *bioProcessBackgroundJobs(void *arg) {
|
|||||||
unsigned long type = (unsigned long) arg;
|
unsigned long type = (unsigned long) arg;
|
||||||
sigset_t sigset;
|
sigset_t sigset;
|
||||||
|
|
||||||
|
/* Check that the type is within the right interval. */
|
||||||
|
if (type >= REDIS_BIO_NUM_OPS) {
|
||||||
|
redisLog(REDIS_WARNING,
|
||||||
|
"Warning: bio thread started with wrong type %lu",type);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/* Make the thread killable at any time, so that bioKillThreads()
|
/* Make the thread killable at any time, so that bioKillThreads()
|
||||||
* can work reliably. */
|
* can work reliably. */
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user