author | simon <simon> | 2002-12-10 11:07:46 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-10 11:07:46 (UTC) |
commit | f468c3bc69655aefa0ec5783405355dd3dde4afc (patch) (side-by-side diff) | |
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) (ignore 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 @@ -28,2 +28,8 @@ class QSocketNotifier; +extern "C" +{ + void *_threadutil_start_thread( void* ); + void _threadutil_terminate_thread( void* ); +} + namespace ThreadUtil @@ -83,2 +89,24 @@ namespace ThreadUtil + class Thread + { + friend void *::_threadutil_start_thread( void* ); + friend void ::_threadutil_terminate_thread( void* ); + public: + Thread(); + virtual ~Thread(); + + void start(); + void terminate(); + + bool wait(); + + static void exit(); + protected: + virtual void run() = 0; + + private: + struct Data; + Data *d; + }; + class OnewayNotifier : public QObject |