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 | |||
@@ -27,4 +27,10 @@ | |||
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 | { |
@@ -82,4 +88,26 @@ namespace ThreadUtil | |||
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 | { |