#include <Worker.h>
Inheritance diagram for ZThread::Worker::

Public Methods | |
| Worker (TaskQueue q) throw (Synchronization_Exception) | |
| virtual | ~Worker () throw () |
| virtual void | kill () throw (Synchronization_Exception) |
| virtual bool | isKilled () throw () |
| virtual void | run () throw () |
Protected Types | |
| typedef Queue<Runnable*>* | TaskQueue |
| Typedef. | |
Protected Methods | |
| void | finished (Runnable *) |
Protected Attributes | |
| TaskQueue | _taskQueue |
| TaskQueue. | |
| bool | _canceled |
| Cancel flag. | |
In addition the template provides specializations for task consuming or task reading workers. A consuming worker destroys tasks it has executed, otherwise it simply executes the task and makes no attempt to destroy that task.
|
|
Create an AsyncWorker associated with a TaskQueue
|
|
|
Destroy the AsyncWorker |
|
|
As each task is completed, it is passed into this method to properly deal with its completion. This function will destroy the taks objects of a consuming worker, otherwise it has no effect.
|
|
|
Check the internal flag to see if this Worker has been killed; or marked as no longer usable
Reimplemented from ZThread::Thread. |
|
|
Mark the thread as killed w/o actuallying kill()ing it and therefore w/o interefering with any task already executing Reimplemented from ZThread::Thread. |
|
|
Tasks will be executed and removed from the queue. Wether or not those tasks are deleted depends on the template parameter. Reimplemented from ZThread::Thread. |
1.2.8 written by Dimitri van Heesch,
© 1997-2001