diff options
author | pixel <pixel> | 2006-10-28 16:42:19 +0000 |
---|---|---|
committer | pixel <pixel> | 2006-10-28 16:42:19 +0000 |
commit | 8fdf9104af7c10a778e4ed6bd0c501c7d2087cdd (patch) | |
tree | d309b4932810ab6e320a287dcd1a24e5e27a15ad /include/Task.h | |
parent | f7f07a91a9a033698b338b21e4a3974da4b518d9 (diff) |
Task manager now has timeout support.
Diffstat (limited to 'include/Task.h')
-rw-r--r-- | include/Task.h | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/include/Task.h b/include/Task.h index 5ac4a26..8831830 100644 --- a/include/Task.h +++ b/include/Task.h @@ -9,16 +9,27 @@ #include <Exceptions.h> #include <Handle.h> -#define TASK_ON_HOLD 0 -#define TASK_DONE 1 -#define TASK_BURST 2 - -#define W4_STICKY 1 -#define W4_READING 2 -#define W4_WRITING 4 +#undef E_HANDLE class Task : public Base { public: + enum { + EVT_BURST = 0, + EVT_HANDLE, + EVT_PROCESS, + EVT_TIMEOUT, + EVT_TASK, + }; + enum { + TASK_ON_HOLD = 0, + TASK_DONE, + TASK_BURST, + }; + enum { + W4_STICKY = 1, + W4_READING = 2, + W4_WRITING = 4, + }; Task(); virtual ~Task(); virtual String GetName(); @@ -29,13 +40,14 @@ class Task : public Base { void WaitFor(Task *); void WaitFor(Handle *, int = 0); void WaitFor(pid_t); - void WaitFor(timeval, int = 0); + void WaitFor(const timeval &, int = 0); Task * WaitedBy(); void SetBurst(); void Stop(); void Restart(); bool IsStopped(); void RemoveFromWatches(); + Handle * BurstHandle; protected: virtual int Do() throw (GeneralException); |