author | simon <simon> | 2002-12-10 11:07:46 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-10 11:07:46 (UTC) |
commit | f468c3bc69655aefa0ec5783405355dd3dde4afc (patch) (unidiff) | |
tree | b358fb36cb4547a0bf2c100573e4846fbc32211c /noncore/multimedia/opieplayer2/threadutil.h | |
parent | 448426777d9e35826898791d03b4bc71335427ff (diff) | |
download | opie-f468c3bc69655aefa0ec5783405355dd3dde4afc.zip opie-f468c3bc69655aefa0ec5783405355dd3dde4afc.tar.gz opie-f468c3bc69655aefa0ec5783405355dd3dde4afc.tar.bz2 |
- added ThreadUtil::Thread class
Diffstat (limited to 'noncore/multimedia/opieplayer2/threadutil.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.h b/noncore/multimedia/opieplayer2/threadutil.h index 5cc4cdc..b537cc1 100644 --- a/noncore/multimedia/opieplayer2/threadutil.h +++ b/noncore/multimedia/opieplayer2/threadutil.h | |||
@@ -26,6 +26,12 @@ | |||
26 | 26 | ||
27 | class QSocketNotifier; | 27 | class QSocketNotifier; |
28 | 28 | ||
29 | extern "C" | ||
30 | { | ||
31 | void *_threadutil_start_thread( void* ); | ||
32 | void _threadutil_terminate_thread( void* ); | ||
33 | } | ||
34 | |||
29 | namespace ThreadUtil | 35 | namespace ThreadUtil |
30 | { | 36 | { |
31 | 37 | ||
@@ -81,6 +87,28 @@ namespace ThreadUtil | |||
81 | WaitCondition &operator=( const WaitCondition & ); | 87 | WaitCondition &operator=( const WaitCondition & ); |
82 | }; | 88 | }; |
83 | 89 | ||
90 | class Thread | ||
91 | { | ||
92 | friend void *::_threadutil_start_thread( void* ); | ||
93 | friend void ::_threadutil_terminate_thread( void* ); | ||
94 | public: | ||
95 | Thread(); | ||
96 | virtual ~Thread(); | ||
97 | |||
98 | void start(); | ||
99 | void terminate(); | ||
100 | |||
101 | bool wait(); | ||
102 | |||
103 | static void exit(); | ||
104 | protected: | ||
105 | virtual void run() = 0; | ||
106 | |||
107 | private: | ||
108 | struct Data; | ||
109 | Data *d; | ||
110 | }; | ||
111 | |||
84 | class OnewayNotifier : public QObject | 112 | class OnewayNotifier : public QObject |
85 | { | 113 | { |
86 | Q_OBJECT | 114 | Q_OBJECT |