diff options
author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-05-04 18:53:31 +0000 |
---|---|---|
committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-05-04 18:53:31 +0000 |
commit | f9fa26c1990e7fb7fc7f4a8f3c19175d2b5eb9c4 (patch) | |
tree | bd46c03a167be729b08f595b7c569489c4f098f9 /tasks.h | |
parent | 71cd02a970f6cb1844c9e94d8a8dcdb71b1bc295 (diff) | |
download | vdr-plugin-live-f9fa26c1990e7fb7fc7f4a8f3c19175d2b5eb9c4.tar.gz vdr-plugin-live-f9fa26c1990e7fb7fc7f4a8f3c19175d2b5eb9c4.tar.bz2 |
- moved grab task into mainthreadloop
Diffstat (limited to 'tasks.h')
-rw-r--r-- | tasks.h | 26 |
1 files changed, 20 insertions, 6 deletions
@@ -1,9 +1,9 @@ #ifndef VDR_LIVE_TASKS_H #define VDR_LIVE_TASKS_H -#include <deque> #include <memory> #include <string> +#include <vector> #include <vdr/channels.h> #include <vdr/thread.h> @@ -14,8 +14,9 @@ class Task; class TaskManager: public cMutex { friend TaskManager& LiveTaskManager(); + friend class StickyTask; - typedef std::deque< Task* > TaskQueue; + typedef std::vector< Task* > TaskList; public: bool Execute( Task& task ); @@ -27,7 +28,11 @@ private: TaskManager(); TaskManager( TaskManager const& ); - TaskQueue m_taskQueue; + void AddStickyTask( Task& task ); + void RemoveStickyTask( Task& task ); + + TaskList m_taskQueue; + TaskList m_stickyTasks; cCondVar m_scheduleWait; }; @@ -42,16 +47,25 @@ public: std::string const& Error() const { return m_error; } protected: - Task(): m_result( true ) {} + explicit Task() + : m_result( true ) + {} Task( Task const& ); void SetError( std::string const& error ) { m_result = false; m_error = error; } - virtual void Action() = 0; - private: bool m_result; std::string m_error; + + virtual void Action() = 0; +}; + +class StickyTask: public Task +{ +protected: + explicit StickyTask(); + virtual ~StickyTask(); }; class SwitchChannelTask: public Task |