-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.h b/noncore/multimedia/opieplayer2/threadutil.h index 2fd0c68..1411535 100644 --- a/noncore/multimedia/opieplayer2/threadutil.h +++ b/noncore/multimedia/opieplayer2/threadutil.h | |||
@@ -56,64 +56,65 @@ namespace ThreadUtil | |||
56 | ~AutoLock() { m_mutex.unlock(); } | 56 | ~AutoLock() { m_mutex.unlock(); } |
57 | 57 | ||
58 | Mutex *operator &() const { return &m_mutex; } | 58 | Mutex *operator &() const { return &m_mutex; } |
59 | 59 | ||
60 | private: | 60 | private: |
61 | Mutex &m_mutex; | 61 | Mutex &m_mutex; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | class WaitCondition | 64 | class WaitCondition |
65 | { | 65 | { |
66 | public: | 66 | public: |
67 | WaitCondition(); | 67 | WaitCondition(); |
68 | ~WaitCondition(); | 68 | ~WaitCondition(); |
69 | 69 | ||
70 | bool wait(); | 70 | bool wait(); |
71 | bool wait( Mutex &mutex ); | 71 | bool wait( Mutex &mutex ); |
72 | 72 | ||
73 | void wakeOne(); | 73 | void wakeOne(); |
74 | void wakeAll(); | 74 | void wakeAll(); |
75 | 75 | ||
76 | private: | 76 | private: |
77 | struct Data; | 77 | struct Data; |
78 | Data *d; | 78 | Data *d; |
79 | 79 | ||
80 | WaitCondition( const WaitCondition & ); | 80 | WaitCondition( const WaitCondition & ); |
81 | WaitCondition &operator=( const WaitCondition & ); | 81 | WaitCondition &operator=( const WaitCondition & ); |
82 | }; | 82 | }; |
83 | 83 | ||
84 | class Thread | 84 | class Thread |
85 | { | 85 | { |
86 | public: | 86 | public: |
87 | struct Data; | 87 | struct Data; |
88 | friend struct Data; | ||
88 | 89 | ||
89 | Thread(); | 90 | Thread(); |
90 | virtual ~Thread(); | 91 | virtual ~Thread(); |
91 | 92 | ||
92 | void start(); | 93 | void start(); |
93 | void terminate(); | 94 | void terminate(); |
94 | 95 | ||
95 | bool wait(); | 96 | bool wait(); |
96 | 97 | ||
97 | bool isRunning() const; | 98 | bool isRunning() const; |
98 | 99 | ||
99 | static void exit(); | 100 | static void exit(); |
100 | protected: | 101 | protected: |
101 | virtual void run() = 0; | 102 | virtual void run() = 0; |
102 | 103 | ||
103 | private: | 104 | private: |
104 | Data *d; | 105 | Data *d; |
105 | }; | 106 | }; |
106 | 107 | ||
107 | class OnewayNotifier : public QObject | 108 | class OnewayNotifier : public QObject |
108 | { | 109 | { |
109 | Q_OBJECT | 110 | Q_OBJECT |
110 | public: | 111 | public: |
111 | OnewayNotifier(); | 112 | OnewayNotifier(); |
112 | ~OnewayNotifier(); | 113 | ~OnewayNotifier(); |
113 | 114 | ||
114 | void notify(); | 115 | void notify(); |
115 | 116 | ||
116 | signals: | 117 | signals: |
117 | void awake(); | 118 | void awake(); |
118 | 119 | ||
119 | private slots: | 120 | private slots: |