ThreadWeaver

shuttingdownstate.cpp
1/* -*- C++ -*-
2 This file implements the ShuttingDownState class.
3
4 SPDX-FileCopyrightText: 2005-2013 Mirko Boehm <mirko@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7
8 $Id: ShuttingDownState.cpp 30 2005-08-16 16:16:04Z mirko $
9*/
10
11#include "shuttingdownstate.h"
12
13namespace ThreadWeaver
14{
15ShuttingDownState::ShuttingDownState(QueueSignals *weaver)
16 : WeaverImplState(weaver)
17{
18}
19
23
25{
26 // ignored: when shutting down, we do not return to the suspended state
27}
28
30{
31 // ignored: when shutting down, we do not return from the suspended state
32}
33
34JobPointer ShuttingDownState::applyForWork(Thread *, bool wasBusy)
35{
36 Q_UNUSED(wasBusy) // except in Q_ASSERT
37 Q_ASSERT(wasBusy == false);
38 return JobPointer(); // tell threads to exit
39}
40
42{
43 // immediately return here
44}
45
47{
48 return ShuttingDown;
49}
50
51}
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
StateId stateId() const override
reimpl
void waitForAvailableJob(Thread *th) override
Wait (by suspending the calling thread) until a job becomes available.
void shutDown() override
Shut down the queue.
void resume() override
Resume job processing.
void suspend() override
Suspend job processing.
JobPointer applyForWork(Thread *th, bool wasBusy) override
Assign a job to an idle thread.
Thread represents a worker thread in a Queue's inventory.
Definition thread.h:28
Base class for all WeaverImpl states.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:57:09 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.