11#include "weaverimplstate.h"
15WeaverImplState::WeaverImplState(QueueSignals *weaver)
20const State *WeaverImplState::state()
const
25void WeaverImplState::shutDown()
27 weaver()->shutDown_p();
32 Q_ASSERT(
dynamic_cast<Weaver *
>(State::weaver()));
33 return static_cast<Weaver *
>(State::weaver());
36const Weaver *WeaverImplState::weaver()
const
38 Q_ASSERT(
dynamic_cast<const Weaver *
>(State::weaver()));
39 return static_cast<const Weaver *
>(State::weaver());
42void WeaverImplState::setMaximumNumberOfThreads(
int cap)
44 weaver()->setMaximumNumberOfThreads_p(cap);
47int WeaverImplState::maximumNumberOfThreads()
const
49 return weaver()->maximumNumberOfThreads_p();
52int WeaverImplState::currentNumberOfThreads()
const
54 return weaver()->currentNumberOfThreads_p();
59 weaver()->enqueue_p(jobs);
64 return weaver()->dequeue_p(job);
67void WeaverImplState::dequeue()
69 weaver()->dequeue_p();
72void WeaverImplState::finish()
77bool WeaverImplState::isEmpty()
const
79 return weaver()->isEmpty_p();
82bool WeaverImplState::isIdle()
const
84 return weaver()->isIdle_p();
87int WeaverImplState::queueLength()
const
89 return weaver()->queueLength_p();
92void WeaverImplState::requestAbort()
94 return weaver()->requestAbort_p();
97void WeaverImplState::reschedule()
102void WeaverImplState::waitForAvailableJob(
Thread *th)
104 weaver()->blockThreadUntilJobsAreBeingAssigned(th);
We use a State pattern to handle the system state in ThreadWeaver.
Thread represents a worker thread in a Queue's inventory.
A Weaver manages worker threads.
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.