author | simon <simon> | 2002-12-11 01:41:39 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 01:41:39 (UTC) |
commit | 2318caf33bf03acfbcbc0ccce61e3e7ff0aac4aa (patch) (unidiff) | |
tree | 0fd4ed36dd54f26d730394fcef85704e04c06842 | |
parent | 3ec7f32d0924c737664a6ad4dfb43dc3c20605d0 (diff) | |
download | opie-2318caf33bf03acfbcbc0ccce61e3e7ff0aac4aa.zip opie-2318caf33bf03acfbcbc0ccce61e3e7ff0aac4aa.tar.gz opie-2318caf33bf03acfbcbc0ccce61e3e7ff0aac4aa.tar.bz2 |
- added bool Thread::isRunning() const
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.h | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index 5687f42..a5cc92d 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp | |||
@@ -211,16 +211,22 @@ bool Thread::wait() | |||
211 | { | 211 | { |
212 | AutoLock lock( d->guard ); | 212 | AutoLock lock( d->guard ); |
213 | if ( !d->isRunning ) | 213 | if ( !d->isRunning ) |
214 | return true; | 214 | return true; |
215 | 215 | ||
216 | return d->finishCondition.wait( d->guard ); | 216 | return d->finishCondition.wait( d->guard ); |
217 | } | 217 | } |
218 | 218 | ||
219 | bool Thread::isRunning() const | ||
220 | { | ||
221 | AutoLock lock( d->guard ); | ||
222 | return d->isRunning; | ||
223 | } | ||
224 | |||
219 | void Thread::exit() | 225 | void Thread::exit() |
220 | { | 226 | { |
221 | pthread_exit( 0 ); | 227 | pthread_exit( 0 ); |
222 | } | 228 | } |
223 | 229 | ||
224 | OnewayNotifier::OnewayNotifier() | 230 | OnewayNotifier::OnewayNotifier() |
225 | { | 231 | { |
226 | int fds[ 2 ]; | 232 | int fds[ 2 ]; |
diff --git a/noncore/multimedia/opieplayer2/threadutil.h b/noncore/multimedia/opieplayer2/threadutil.h index b537cc1..b67b61d 100644 --- a/noncore/multimedia/opieplayer2/threadutil.h +++ b/noncore/multimedia/opieplayer2/threadutil.h | |||
@@ -95,16 +95,18 @@ namespace ThreadUtil | |||
95 | Thread(); | 95 | Thread(); |
96 | virtual ~Thread(); | 96 | virtual ~Thread(); |
97 | 97 | ||
98 | void start(); | 98 | void start(); |
99 | void terminate(); | 99 | void terminate(); |
100 | 100 | ||
101 | bool wait(); | 101 | bool wait(); |
102 | 102 | ||
103 | bool isRunning() const; | ||
104 | |||
103 | static void exit(); | 105 | static void exit(); |
104 | protected: | 106 | protected: |
105 | virtual void run() = 0; | 107 | virtual void run() = 0; |
106 | 108 | ||
107 | private: | 109 | private: |
108 | struct Data; | 110 | struct Data; |
109 | Data *d; | 111 | Data *d; |
110 | }; | 112 | }; |