X-Git-Url: https://git.saurik.com/redis.git/blobdiff_plain/c1ae36aea814e1bcb0f046a00b51ed46d7432c3b..4610b0332c199563e58de005eb1b10ed54e1ec9c:/src/vm.c diff --git a/src/vm.c b/src/vm.c index 6c0d79b0..ee831fb9 100644 --- a/src/vm.c +++ b/src/vm.c @@ -110,6 +110,11 @@ void vmInit(void) { /* LZF requires a lot of stack */ pthread_attr_init(&server.io_threads_attr); pthread_attr_getstacksize(&server.io_threads_attr, &stacksize); + + /* Solaris may report a stacksize of 0, let's set it to 1 otherwise + * multiplying it by 2 in the while loop later will not really help ;) */ + if (!stacksize) stacksize = 1; + while (stacksize < REDIS_THREAD_STACK_SIZE) stacksize *= 2; pthread_attr_setstacksize(&server.io_threads_attr, stacksize); /* Listen for events in the threaded I/O pipe */ @@ -566,7 +571,7 @@ void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata, REDIS_NOTUSED(mask); REDIS_NOTUSED(privdata); - if (privdata == NULL) trytoswap = 0; /* check the comments above... */ + if (privdata != NULL) trytoswap = 0; /* check the comments above... */ /* For every byte we read in the read side of the pipe, there is one * I/O job completed to process. */