Ejemplo n.º 1
0
JobPointer SuspendedState::applyForWork(Thread *th, bool wasBusy)
{
    // suspend all threads in case they wake up:
    Q_ASSERT(wasBusy == 0);
    weaver()->waitForAvailableJob(th);
    return weaver()->applyForWork(th, wasBusy);
}
Ejemplo n.º 2
0
 Job* InConstructionState::applyForWork ( Thread *th,  Job *previous)
 {
     // As long as we are in the construction state, no jobs will be given
     // to the worker threads. The threads will be suspended. They will
     // return from the blocked state when jobs are queued. By then, we
     // should not be in InConstruction state anymore, and we hand the job
     // application over to the then active state.
     while ( weaver()->state().stateId() == InConstruction )
     {
         weaver()->waitForAvailableJob ( th);
     }
     return weaver()->applyForWork ( th,  previous );
 }
Ejemplo n.º 3
0
void SuspendedState::resume()
{
    weaver()->setState(WorkingHard);
}
Ejemplo n.º 4
0
 void InConstructionState::waitForAvailableJob ( Thread * th)
 {
     weaver()->blockThreadUntilJobsAreBeingAssigned ( th );
 }