ThreadWeaver

shuttingdownstate.h
1/* -*- C++ -*-
2 This file declares 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.h 32 2005-08-17 08:38:01Z mirko $
9*/
10
11#ifndef ShuttingDownState_H
12#define ShuttingDownState_H
13
14#include "weaverimplstate.h"
15
16namespace ThreadWeaver
17{
18class Queue;
19
20/** ShuttingDownState is enabled when the Weaver destructor is entered. It
21 * prevents threads from still accessing queue management methods, and new jobs being queued.
22 */
24{
25public:
27
28 /** Shut down the queue. */
29 void shutDown() override;
30 /** Suspend job processing. */
31 void suspend() override;
32 /** Resume job processing. */
33 void resume() override;
34 /** Assign a job to an idle thread. */
35 JobPointer applyForWork(Thread *th, bool wasBusy) override;
36 /** Wait (by suspending the calling thread) until a job becomes available. */
37 void waitForAvailableJob(Thread *th) override;
38 /** reimpl */
39 StateId stateId() const override;
40};
41
42}
43
44#endif // ShuttingDownState_H
QueueSignals declares the Qt signals shared by the Queue and Weaver classes.
ShuttingDownState is enabled when the Weaver destructor is entered.
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.
Weaver * weaver() override
Provide correct return type for WeaverImpl states.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 12 2024 11:52:00 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.