From f468c3bc69655aefa0ec5783405355dd3dde4afc Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 10 Dec 2002 11:07:46 +0000 Subject: - added ThreadUtil::Thread class --- (limited to 'noncore/multimedia/opieplayer2/threadutil.h') 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 @@ class QSocketNotifier; +extern "C" +{ + void *_threadutil_start_thread( void* ); + void _threadutil_terminate_thread( void* ); +} + namespace ThreadUtil { @@ -81,6 +87,28 @@ namespace ThreadUtil WaitCondition &operator=( const WaitCondition & ); }; + 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 { Q_OBJECT -- cgit v0.9.0.2