* of an unix pipe in order to "awake" the main thread, and this function
* is called.
*
- * If privdata != NULL the function will try to put more jobs in the queue
- * of IO jobs to process as more room is made. */
+ * If privdata == NULL the function will try to put more jobs in the queue
+ * of IO jobs to process as more room is made. privdata is equal to NULL
+ * when the function is called from the event loop, so we want to push
+ * more IO jobs in the queue. Instead when the function is called by
+ * other functions that want to create a write-barrier to avoid race
+ * conditions we don't push new jobs in the queue. */
void vmThreadedIOCompletedJob(aeEventLoop *el, int fd, void *privdata,
int mask)
{
freeIOJob(j);
}
processed++;
- if (privdata != NULL) cacheScheduleIOPushJobs(0);
+ if (privdata == NULL) cacheScheduleIOPushJobs(0);
if (processed == toprocess) return;
}
if (retval < 0 && errno != EAGAIN) {
/* Signal the main thread there is new stuff to process */
redisAssert(write(server.io_ready_pipe_write,"x",1) == 1);
- redisLog(REDIS_WARNING,"TIME (%c): %lld\n", j->type == REDIS_IOJOB_LOAD ? 'L' : 'S', ustime()-start);
+ redisLog(REDIS_DEBUG,"TIME (%c): %lld\n", j->type == REDIS_IOJOB_LOAD ? 'L' : 'S', ustime()-start);
}
/* never reached, but that's the full pattern... */
unlockThreadedIO();