summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/threadutil.h
authorsimon <simon>2002-12-10 11:07:46 (UTC)
committer simon <simon>2002-12-10 11:07:46 (UTC)
commitf468c3bc69655aefa0ec5783405355dd3dde4afc (patch) (unidiff)
treeb358fb36cb4547a0bf2c100573e4846fbc32211c /noncore/multimedia/opieplayer2/threadutil.h
parent448426777d9e35826898791d03b4bc71335427ff (diff)
downloadopie-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.h28
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
27class QSocketNotifier; 27class QSocketNotifier;
28 28
29extern "C"
30{
31 void *_threadutil_start_thread( void* );
32 void _threadutil_terminate_thread( void* );
33}
34
29namespace ThreadUtil 35namespace 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