if ((stat = pthread_attr_init(&jq->attr)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_attr_init: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_attr_init: ERR=%s\n"), be.strerror(stat));
return stat;
}
if ((stat = pthread_attr_setdetachstate(&jq->attr, PTHREAD_CREATE_DETACHED)) != 0) {
}
if ((stat = pthread_mutex_init(&jq->mutex, NULL)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_init: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_mutex_init: ERR=%s\n"), be.strerror(stat));
pthread_attr_destroy(&jq->attr);
return stat;
}
if ((stat = pthread_cond_init(&jq->work, NULL)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_init: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_cond_init: ERR=%s\n"), be.strerror(stat));
pthread_mutex_destroy(&jq->mutex);
pthread_attr_destroy(&jq->attr);
return stat;
}
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_mutex_lock: ERR=%s\n"), be.strerror(stat));
return stat;
}
jq->valid = 0; /* prevent any more operations */
if (jq->idle_workers) {
if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_broadcast: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_cond_broadcast: ERR=%s\n"), be.strerror(stat));
pthread_mutex_unlock(&jq->mutex);
return stat;
}
while (jq->num_workers > 0) {
if ((stat = pthread_cond_wait(&jq->work, &jq->mutex)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_wait: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_cond_wait: ERR=%s\n"), be.strerror(stat));
pthread_mutex_unlock(&jq->mutex);
return stat;
}
}
if ((stat = pthread_mutex_unlock(&jq->mutex)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_unlock: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_mutex_unlock: ERR=%s\n"), be.strerror(stat));
return stat;
}
stat = pthread_mutex_destroy(&jq->mutex);
sched_pkt = (wait_pkt *)malloc(sizeof(wait_pkt));
sched_pkt->jcr = jcr;
sched_pkt->jq = jq;
-// jcr->use_count--; /* release our use of jcr */
stat = pthread_create(&id, &jq->attr, sched_wait, (void *)sched_pkt);
if (stat != 0) { /* thread not created */
berrno be;
- Jmsg1(jcr, M_ERROR, 0, "pthread_thread_create: ERR=%s\n", be.strerror(stat));
+ Jmsg1(jcr, M_ERROR, 0, _("pthread_thread_create: ERR=%s\n"), be.strerror(stat));
}
return stat;
}
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
berrno be;
- Jmsg1(jcr, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+ Jmsg1(jcr, M_ERROR, 0, _("pthread_mutex_lock: ERR=%s\n"), be.strerror(stat));
jcr->use_count--; /* release jcr */
return stat;
}
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_mutex_lock: ERR=%s\n"), be.strerror(stat));
return stat;
}
Dmsg0(2300, "Signal worker to wake up\n");
if ((stat = pthread_cond_broadcast(&jq->work)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_cond_signal: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_cond_signal: ERR=%s\n"), be.strerror(stat));
return stat;
}
} else if (jq->num_workers < jq->max_workers) {
set_thread_concurrency(jq->max_workers + 1);
if ((stat = pthread_create(&id, &jq->attr, jobq_server, (void *)jq)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_create: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_create: ERR=%s\n"), be.strerror(stat));
return stat;
}
}
Dmsg0(2300, "Start jobq_server\n");
if ((stat = pthread_mutex_lock(&jq->mutex)) != 0) {
berrno be;
- Jmsg1(NULL, M_ERROR, 0, "pthread_mutex_lock: ERR=%s\n", be.strerror(stat));
+ Jmsg1(NULL, M_ERROR, 0, _("pthread_mutex_lock: ERR=%s\n"), be.strerror(stat));
return NULL;
}
jq->num_workers++;
jcr->JobStatus != JS_Terminated &&
jcr->JobStatus != JS_Canceled &&
jcr->job->RescheduleTimes > 0 &&
+ jcr->JobType == JT_BACKUP &&
jcr->reschedule_count < jcr->job->RescheduleTimes) {
char dt[50];
njcr->reschedule_count = jcr->reschedule_count;
njcr->JobLevel = jcr->JobLevel;
njcr->JobStatus = jcr->JobStatus;
- copy_storage(njcr, jcr);
+ copy_storage(njcr, jcr->storage);
njcr->messages = jcr->messages;
Dmsg0(2300, "Call to run new job\n");
V(jq->mutex);