ThreadWeaver

suspendedstate.cpp
1 /* -*- C++ -*-
2  This file implements the SuspendedState class.
3 
4  SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 
8  $Id: SuspendedState.cpp 30 2005-08-16 16:16:04Z mirko $
9 */
10 
11 #include "suspendedstate.h"
12 
13 #include "threadweaver.h"
14 
15 namespace ThreadWeaver
16 {
17 SuspendedState::SuspendedState(Weaver *weaver)
18  : WeaverImplState(weaver)
19 {
20 }
21 
23 {
24  // this request is not handled in Suspended state
25 }
26 
28 {
29  weaver()->setState(WorkingHard);
30 }
31 
33 {
34  // suspend all threads in case they wake up:
35  Q_ASSERT(wasBusy == 0);
37  return weaver()->applyForWork(th, wasBusy);
38 }
39 
40 StateId SuspendedState::stateId() const
41 {
42  return Suspended;
43 }
44 
45 }
void suspend() override
Suspend job processing.
JobPointer applyForWork(Thread *thread, bool wasBusy) override
Assign a job to the calling thread.
Definition: weaver.cpp:573
Weaver * weaver() override
Provide correct return type for WeaverImpl states.
void waitForAvailableJob(Thread *th) override
Wait for a job to become available.
Definition: weaver.cpp:579
JobPointer applyForWork(Thread *th, bool wasBusy) override
Assign a job to an idle thread.
void setState(StateId)
Set the Weaver state.
Definition: weaver.cpp:126
Thread represents a worker thread in a Queue's inventory.
Definition: thread.h:27
StateId stateId() const override
reimpl
void resume() override
Resume job processing.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:07:51 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.