ThreadWeaver
queueinterface.h
85 * You can always call dequeue, it will return true if the job was dequeued. However if the job is not in the queue anymore,
86 * it is already being executed, it is too late to dequeue, and dequeue will return false. The return value is thread-safe - if
87 * true is returned, the job was still waiting, and has been dequeued. If not, the job was not waiting in the queue.
89 * Modifying queued jobs is best done on a suspended queue. Often, for example at the end of an application, it is sufficient
90 * to dequeue all jobs (which leaves only the ones mid-air in threads), call finish (that will wait for all the mid air jobs to
91 * complete), and then exit. Without dequeue(), all jobs in the queue would be executed during finish().
152 * This method triggers a scheduling attempt to perform jobs. It will schedule enqueued jobs to be executed by idle threads.
WeaverInterface provides a common interface for weaver implementations.
Definition queueinterface.h:45
virtual bool isEmpty() const =0
Is the queue empty? The queue is empty if no more jobs are queued.
virtual void requestAbort()=0
Request aborts of the currently executed jobs.
virtual void enqueue(const QList< JobPointer > &jobs)=0
Queue a vector of jobs.
virtual bool isIdle() const =0
Is the weaver idle? The weaver is idle if no jobs are queued and no jobs are processed by the threads...
virtual int currentNumberOfThreads() const =0
Returns the current number of threads in the inventory.
virtual void finish()=0
Finish all queued operations, then return.
virtual bool dequeue(const JobPointer &job)=0
Remove a job from the queue.
virtual int maximumNumberOfThreads() const =0
Get the maximum number of threads this Weaver may start.
virtual int queueLength() const =0
Returns the number of pending jobs.
virtual void setMaximumNumberOfThreads(int cap)=0
Set the maximum number of threads this Weaver object may start.
virtual const State * state() const =0
Return the state of the weaver object.
virtual void reschedule()=0
Reschedule the jobs in the queue.
We use a State pattern to handle the system state in ThreadWeaver.
Definition state.h:56
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:58:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 8 2024 11:58:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.