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
20void ShuttingDownState::shutDown()
21{
22}
23
24void ShuttingDownState::suspend()
25{
26 // ignored: when shutting down, we do not return to the suspended state
27}
28
29void ShuttingDownState::resume()
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
41void ShuttingDownState::waitForAvailableJob(Thread *)
42{
43 // immediately return here
44}
45
46StateId ShuttingDownState::stateId() const
47{
48 return ShuttingDown;
49}
50
51}
Lambda is a template that takes any type on which operator() is available, and executes it in run().
Definition lambda.h:20
Thread represents a worker thread in a Queue's inventory.
Definition thread.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:31 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.