static pthread_mutex_t bio_mutex;
static pthread_cond_t bio_condvar;
-list *bio_jobs;
+static list *bio_jobs;
/* This structure represents a background Job. It is only used locally to this
* file as the API deos not expose the internals at all. */
job->data = data;
pthread_mutex_lock(&bio_mutex);
listAddNodeTail(bio_jobs,job);
+ pthread_cond_signal(&bio_condvar);
pthread_mutex_unlock(&bio_mutex);
}
listNode *ln;
/* The loop always starts with the lock hold. */
- if (listLength(server.io_newjobs) == 0) {
+ if (listLength(bio_jobs) == 0) {
pthread_cond_wait(&bio_condvar,&bio_mutex);
continue;
}