summaryrefslogtreecommitdiff
path: root/noncore/multimedia/opieplayer2/threadutil.cpp
Unidiff
Diffstat (limited to 'noncore/multimedia/opieplayer2/threadutil.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/multimedia/opieplayer2/threadutil.cpp6
1 files changed, 6 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
@@ -207,24 +207,30 @@ void Thread::terminate()
207 pthread_cancel( d->self ); 207 pthread_cancel( d->self );
208} 208}
209 209
210bool Thread::wait() 210bool 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
219bool Thread::isRunning() const
220{
221 AutoLock lock( d->guard );
222 return d->isRunning;
223}
224
219void Thread::exit() 225void Thread::exit()
220{ 226{
221 pthread_exit( 0 ); 227 pthread_exit( 0 );
222} 228}
223 229
224OnewayNotifier::OnewayNotifier() 230OnewayNotifier::OnewayNotifier()
225{ 231{
226 int fds[ 2 ]; 232 int fds[ 2 ];
227 pipe( fds ); 233 pipe( fds );
228 m_readFd = fds[ 0 ]; 234 m_readFd = fds[ 0 ];
229 m_writeFd = fds[ 1 ]; 235 m_writeFd = fds[ 1 ];
230 236