|
|
|
|
|
|
|
|
return(*myJob_);
|
|
|
return(*myJob_);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Worker::clearJob() { // Forget about the job.
|
|
|
|
|
|
myJob_ = 0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
LogicCheck CheckForOneJobAtATime("Worker::doJob() Check(false == isJob())");
|
|
|
LogicCheck CheckForOneJobAtATime("Worker::doJob() Check(false == isJob())");
|
|
|
|
|
|
|
|
|
void Worker::doJob(Job& J) { // Give this worker a job to do.
|
|
|
void Worker::doJob(Job& J) { // Give this worker a job to do.
|
|
|
|
|
|
|
|
|
ScopeMutex CallTheBall(Busy); // We're busy - don't touch.
|
|
|
ScopeMutex CallTheBall(Busy); // We're busy - don't touch.
|
|
|
if(isJob()) { // Only do a job if we have one.
|
|
|
if(isJob()) { // Only do a job if we have one.
|
|
|
myJob().doIt();
|
|
|
myJob().doIt();
|
|
|
|
|
|
clearJob();
|
|
|
return true;
|
|
|
return true;
|
|
|
}
|
|
|
}
|
|
|
return false;
|
|
|
return false;
|