34class THREADWEAVER_EXPORT
Weaver :
public QueueAPI
40 void shutDown()
override;
41 void shutDown_p()
override;
43 const State *state()
const override;
44 State *state()
override;
46 void setMaximumNumberOfThreads(
int cap)
override;
47 int maximumNumberOfThreads()
const override;
48 int currentNumberOfThreads()
const override;
50 void setState(StateId);
53 void dequeue()
override;
54 void finish()
override;
56 void resume()
override;
57 bool isEmpty()
const override;
58 bool isIdle()
const override;
59 int queueLength()
const override;
61 void waitForAvailableJob(
Thread *th)
override;
62 void blockThreadUntilJobsAreBeingAssigned(
Thread *th);
63 void blockThreadUntilJobsAreBeingAssigned_locked(
Thread *th);
64 void incActiveThreadCount();
65 void decActiveThreadCount();
66 int activeThreadCount();
68 void threadEnteredRun(
Thread *thread);
69 JobPointer takeFirstAvailableJobOrSuspendOrWait(
Thread *th,
bool threadWasBusy,
bool suspendIfAllThreadsInactive,
bool justReturning);
70 void requestAbort()
override;
71 void reschedule()
override;
76 void setState_p(StateId);
77 void setMaximumNumberOfThreads_p(
int cap)
override;
78 int maximumNumberOfThreads_p()
const override;
79 int currentNumberOfThreads_p()
const override;
82 void dequeue_p()
override;
83 void finish_p()
override;
84 void suspend_p()
override;
85 void resume_p()
override;
86 bool isEmpty_p()
const override;
87 bool isIdle_p()
const override;
88 int queueLength_p()
const override;
89 void requestAbort_p()
override;
100 void adjustActiveThreadCount(
int diff);
101 virtual Thread *createThread();
102 void adjustInventory(
int noOfNewJobs);
105 ThreadWeaver::Private::Weaver_Private *d();
106 const ThreadWeaver::Private::Weaver_Private *d()
const;
We use a State pattern to handle the system state in ThreadWeaver.
SuspendingState is the state after suspend() has been called, but before all threads finished executi...
Thread represents a worker thread in a Queue's inventory.
Base class for all WeaverImpl states.
A Weaver manages worker threads.
void threadSuspended(ThreadWeaver::Thread *)
A thread has been suspended.
void threadExited(ThreadWeaver::Thread *)
A thread has exited.
void threadStarted(ThreadWeaver::Thread *)
A Thread has been created.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:09:38 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.