Marble
7#include "AbstractWorkerThread.h"
8#include "MarbleDebug.h"
16const int WAIT_ATTEMPTS = 20;
17const int WAIT_TIME = 100;
19class AbstractWorkerThreadPrivate
22 explicit AbstractWorkerThreadPrivate(AbstractWorkerThread *parent)
29 ~AbstractWorkerThreadPrivate()
35 QMutex m_runningMutex;
39 AbstractWorkerThread *m_parent;
42AbstractWorkerThread::AbstractWorkerThread(QObject *parent)
44 , d(new AbstractWorkerThreadPrivate(this))
48AbstractWorkerThread::~AbstractWorkerThread()
53void AbstractWorkerThread::ensureRunning()
57 if (wait(2 * WAIT_TIME)) {
64void AbstractWorkerThread::run()
66 int waitAttempts = WAIT_ATTEMPTS;
68 d->m_runningMutex.lock();
69 if (!workAvailable()) {
71 if (!waitAttempts || d->m_end) {
73 d->m_runningMutex.unlock();
76 d->m_runningMutex.unlock();
80 d->m_runningMutex.unlock();
83 waitAttempts = WAIT_ATTEMPTS;
90#include "moc_AbstractWorkerThread.cpp"
Q_SCRIPTABLE Q_NOREPLY void start()
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:52:08 by
doxygen 1.13.2 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.