![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
Thread safe access to a WorkerJob.
Is automatically reset when the Job finishes.
Definition at line 85 of file workerthread.h.
#include <workerthread.h>
Public Member Functions | |
WorkerJobHandle () | |
default constructor with no job More... | |
void | startJob (WorkerJob *new_job) |
start a new job More... | |
void | cancelJob () |
request the job to be cancelled More... | |
void | invalidate (WorkerJob *ajob) |
release control of the WorkerJob object More... | |
void | shutDown () |
cancel all remaining tasks and shut down the global QThreaPool More... | |
Private Attributes | |
QMutex | mut |
mutex protects read/write access. More... | |
WorkerJob * | job |
the actual Worker Job object. More... | |
|
inline |
default constructor with no job
Definition at line 94 of file workerthread.h.
void WorkerJobHandle::cancelJob | ( | ) |
request the job to be cancelled
Note that this method does not stop the long-running tasks immediately. It only raises the canclJob flag. Long-running tasks are expected to poll the flag in regular intervals, and throw an InterruptedException. The exception is caught by the run() method.
Definition at line 33 of file workerthread.cpp.
void WorkerJobHandle::invalidate | ( | WorkerJob * | ajob | ) |
release control of the WorkerJob object
ajob | a worker job |
Definition at line 22 of file workerthread.cpp.
void WorkerJobHandle::shutDown | ( | ) |
cancel all remaining tasks and shut down the global QThreaPool
Definition at line 39 of file workerthread.cpp.
void WorkerJobHandle::startJob | ( | WorkerJob * | new_job | ) |
start a new job
new_job | pointer to job |
Note: ownership of job object passes to QThreadPool. Do not delete the object youself!
Definition at line 11 of file workerthread.cpp.
|
private |
the actual Worker Job object.
Definition at line 91 of file workerthread.h.
|
private |
mutex protects read/write access.
Definition at line 89 of file workerthread.h.