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 | |||
@@ -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 |