#include <dynamicthread.h>
|
bool | runningFlag () const volatile |
|
void | shutDown () |
|
void | start (QMutexLocker< QMutex > &locker) |
|
void | stop (const QMutexLocker< QMutex > &locker) |
|
QMutex * | threadMutex () const |
|
void | wait (QMutexLocker< QMutex > &locker) |
|
◆ State
Enumerator |
---|
Inactive | |
Scheduled | |
Running | |
Deactivating | |
◆ DynamicThread()
Digikam::DynamicThread::DynamicThread |
( |
QObject *const |
parent = nullptr | ) |
|
|
explicit |
◆ ~DynamicThread()
Digikam::DynamicThread::~DynamicThread |
( |
| ) |
|
|
override |
The destructor calls stop() and wait(), but if you, in your destructor, delete any data that is accessed by your run() method, you must call stop() and wait() before yourself.
References shutDown().
◆ finished
void Digikam::DynamicThread::finished |
( |
| ) |
|
|
signal |
◆ isFinished()
bool Digikam::DynamicThread::isFinished |
( |
| ) |
const |
◆ isRunning()
bool Digikam::DynamicThread::isRunning |
( |
| ) |
const |
◆ priority()
QThread::Priority Digikam::DynamicThread::priority |
( |
| ) |
const |
◆ run()
virtual void Digikam::DynamicThread::run |
( |
| ) |
|
|
pure virtual |
◆ runningFlag()
bool Digikam::DynamicThread::runningFlag |
( |
| ) |
const volatile |
|
protected |
◆ setEmitSignals()
void Digikam::DynamicThread::setEmitSignals |
( |
bool |
emitThem | ) |
|
◆ setPriority()
void Digikam::DynamicThread::setPriority |
( |
QThread::Priority |
priority | ) |
|
Sets the priority for this dynamic thread. Can be set anytime. If the thread is currently not running, the priority will be set when it is run next time. When you set QThread::InheritPriority (default), the priority is not changed but inherited from the thread pool.
References priority().
Referenced by Digikam::FacePipeline::Private::createThumbnailLoadThread().
◆ shutDown()
void Digikam::DynamicThread::shutDown |
( |
| ) |
|
|
protected |
If you are deleting data in your destructor which is accessed from the thread, do one of the following from your destructor to guarantee a safe shutdown: 1) Call this method 2) Call stop() and wait(), knowing that nothing will call start() anymore after this 3) Be sure the thread will never be running at destruction. Note: This irrevocably stops this object. Note: It is not sufficient that your parent class does this. Calling this method, or providing one of the above mentioned equivalent guarantees, must be done by every single last class in the hierarchy with an implemented destructor deleting data. (the base class destructor is always called after the derived class)
References stop(), and wait().
Referenced by Digikam::ManagedLoadSaveThread::shutDown(), ~DynamicThread(), and Digikam::LoadSaveThread::~LoadSaveThread().
◆ start [1/2]
void Digikam::DynamicThread::start |
( |
| ) |
|
|
slot |
References start().
Referenced by Digikam::ImageHistogram::calculateInThread(), Digikam::FacePreviewLoader::checkRestart(), Digikam::ImageHistogram::getCount(), Digikam::ImageHistogram::getMaximum(), Digikam::ImageHistogram::getMean(), Digikam::ImageHistogram::getMedian(), Digikam::ImageHistogram::getStdDev(), Digikam::LoadSaveThread::load(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadThumbnail(), Digikam::DImgThreadedFilter::multithreadedSteps(), Digikam::ManagedLoadSaveThread::preloadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnailGroup(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::ScanStateFilter::process(), Digikam::ManagedLoadSaveThread::save(), Digikam::LoadSaveThread::save(), start(), and Digikam::DImgThreadedFilter::startFilter().
◆ start() [2/2]
void Digikam::DynamicThread::start |
( |
QMutexLocker< QMutex > & |
locker | ) |
|
|
protected |
◆ starting
void Digikam::DynamicThread::starting |
( |
| ) |
|
|
signal |
Emitted if emitSignals is enabled
◆ state()
◆ stop [1/2]
void Digikam::DynamicThread::stop |
( |
| ) |
|
|
slot |
◆ stop() [2/2]
void Digikam::DynamicThread::stop |
( |
const QMutexLocker< QMutex > & |
locker | ) |
|
|
protected |
◆ threadMutex()
QMutex * Digikam::DynamicThread::threadMutex |
( |
| ) |
const |
|
protected |
This is the non-recursive mutex used to protect state variables and waiting in this class. You can use it if you want to protect your memory in the same scope as calling start, stop or wait, then using the QMutexLocker variants below. Note that when you have locked this mutex, you must use these variants, as the mutex is non-recursive.
Referenced by Digikam::ScanStateFilter::dispatch(), Digikam::LoadSaveThread::load(), Digikam::ManagedLoadSaveThread::load(), Digikam::ManagedLoadSaveThread::loadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnail(), Digikam::ManagedLoadSaveThread::preloadThumbnailGroup(), Digikam::ManagedLoadSaveThread::prependThumbnailGroup(), Digikam::ScanStateFilter::process(), Digikam::ScanStateFilter::process(), Digikam::LoadSaveThread::run(), Digikam::ScanStateFilter::run(), Digikam::ManagedLoadSaveThread::save(), Digikam::LoadSaveThread::save(), Digikam::ManagedLoadSaveThread::shutDown(), Digikam::ManagedLoadSaveThread::stopAllTasks(), Digikam::ManagedLoadSaveThread::stopLoading(), Digikam::ManagedLoadSaveThread::stopLoading(), Digikam::ManagedLoadSaveThread::stopSaving(), and Digikam::LoadSaveThread::taskHasFinished().
◆ wait [1/2]
void Digikam::DynamicThread::wait |
( |
| ) |
|
|
slot |
◆ wait() [2/2]
void Digikam::DynamicThread::wait |
( |
QMutexLocker< QMutex > & |
locker | ) |
|
|
protected |
◆ DynamicThreadPriv
friend class DynamicThreadPriv |
|
friend |
The documentation for this class was generated from the following files: