11 namespace frechet {
namespace app {
13 class WorkerJobHandle;
75 virtual void run()
override;
111 #endif // WORKERTHREAD_H WorkerJobHandle()
default constructor with no job
virtual void afterInterrupted()=0
virtual void runJob()=0
abstract method for starting the job
WorkerJobHandle * handle
reference to thread-safe handle
global definitions for all algorithms.
volatile bool cancelRequested
cancellation flag
void invalidate(WorkerJob *ajob)
release control of the WorkerJob object
void cancelJob()
request the job to be cancelled
thrown by long-runner tasks
virtual void run() override
abstract method that performs the long-running task
Background job to run long-runner tasks in a seperate thread.
void shutDown()
cancel all remaining tasks and shut down the global QThreaPool
void startJob(WorkerJob *new_job)
start a new job
Thread safe access to a WorkerJob.
WorkerJob * job
the actual Worker Job object.
QMutex mut
mutex protects read/write access.