void destroy_mutex(void) {pthread_mutex_destroy(&mutex); };
bool is_job_canceled() {return job_canceled(this); };
int32_t get_JobType() { return m_JobType; };
+ int32_t getJobType() { return m_JobType; };
int32_t get_JobLevel() { return m_JobLevel; };
+ int32_t getJobLevel() { return m_JobLevel; };
bool no_client_used() {
return (m_JobType == JT_MIGRATE || m_JobType == JT_COPY ||
m_JobLevel == L_VIRTUAL_FULL);
};
- const char *get_OperationName(); /* in lib/jcr.c */
+ const char *get_OperationName(); /* in lib/jcr.c */
const char *get_ActionName(bool past); /* in lib/jcr.c */
- void set_JobLevel(int32_t JobLevel); /* in lib/jcr.c */
- void set_JobType(int32_t JobType); /* in lib/jcr.c */
- bool JobReads(); /* in lib/jcr.c */
+ void set_JobLevel(int32_t JobLevel); /* in lib/jcr.c */
+ void setJobLevel(int32_t JobLevel); /* in lib/jcr.c */
+ void set_JobType(int32_t JobType); /* in lib/jcr.c */
+ void setJobType(int32_t JobType); /* in lib/jcr.c */
+ void setJobStatus(int JobStatus); /* in lib/jcr.c */
+ bool JobReads(); /* in lib/jcr.c */
+
/* Global part of JCR common to all daemons */
dlink link; /* JCR chain link */
switch (JobStatus) {
case JS_ErrorTerminated:
case JS_FatalError:
- priority = 10;
- break;
case JS_Canceled:
- priority = 9;
+ priority = 10;
break;
case JS_Error:
priority = 8;
void set_jcr_job_status(JCR *jcr, int JobStatus)
{
+ jcr->setJobStatus(JobStatus);
+}
+
+void JCR::setJobStatus(int JobStatus)
+{
+ JCR *jcr = this;
int priority, old_priority;
- int oldJobStatus = jcr->JobStatus;
+ int oldJobStatus = JobStatus;
priority = get_status_priority(JobStatus);
old_priority = get_status_priority(oldJobStatus);
- Dmsg2(800, "set_jcr_job_status(%s, %c)\n", jcr->Job, JobStatus);
+ Dmsg2(800, "set_jcr_job_status(%s, %c)\n", Job, JobStatus);
/* Update wait_time depending on newJobStatus and oldJobStatus */
- update_wait_time(jcr, JobStatus);
+ update_wait_time(this, JobStatus);
/*
* For a set of errors, ... keep the current status
* so it isn't lost. For all others, set it.
*/
- Dmsg3(300, "jid=%u OnEntry JobStatus=%c set=%c\n", (uint32_t)jcr->JobId,
- jcr->JobStatus, JobStatus);
+ Dmsg3(300, "jid=%u OnEntry JobStatus=%c set=%c\n", (uint32_t)JobId,
+ JobStatus, JobStatus);
if (priority >= old_priority) {
jcr->JobStatus = JobStatus; /* replace with new priority */
}