author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/multimedia/opieplayer2/threadutil.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/multimedia/opieplayer2/threadutil.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index fb951b4..d8b8abe 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp | |||
@@ -178,34 +178,34 @@ Thread::Thread() | |||
178 | 178 | ||
179 | Thread::~Thread() | 179 | Thread::~Thread() |
180 | { | 180 | { |
181 | assert( d->isRunning == false ); | 181 | assert( d->isRunning == false ); |
182 | delete d; | 182 | delete d; |
183 | } | 183 | } |
184 | 184 | ||
185 | void Thread::start() | 185 | void Thread::start() |
186 | { | 186 | { |
187 | AutoLock lock( d->guard ); | 187 | AutoLock lock( d->guard ); |
188 | 188 | ||
189 | if ( d->isRunning ) { | 189 | if ( d->isRunning ) { |
190 | qDebug( "ThreadUtil::Thread::start() called for running thread." ); | 190 | odebug << "ThreadUtil::Thread::start() called for running thread." << oendl; |
191 | return; | 191 | return; |
192 | } | 192 | } |
193 | 193 | ||
194 | pthread_attr_t attributes; | 194 | pthread_attr_t attributes; |
195 | pthread_attr_init( &attributes ); | 195 | pthread_attr_init( &attributes ); |
196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); | 196 | pthread_attr_setscope( &attributes, PTHREAD_SCOPE_SYSTEM ); |
197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); | 197 | int err = pthread_create( &d->self, &attributes, start_thread, ( void* )d ); |
198 | if ( err != 0 ) { | 198 | if ( err != 0 ) { |
199 | qDebug( "ThreadUtil::Thread::start() : can't create thread: %s", strerror( err ) ); | 199 | odebug << "ThreadUtil::Thread::start() : can't create thread: " << strerror( err ) << "" << oendl; |
200 | pthread_attr_destroy( &attributes ); | 200 | pthread_attr_destroy( &attributes ); |
201 | return; | 201 | return; |
202 | } | 202 | } |
203 | pthread_attr_destroy( &attributes ); | 203 | pthread_attr_destroy( &attributes ); |
204 | } | 204 | } |
205 | 205 | ||
206 | void Thread::terminate() | 206 | void Thread::terminate() |
207 | { | 207 | { |
208 | AutoLock lock( d->guard ); | 208 | AutoLock lock( d->guard ); |
209 | if ( !d->isRunning ) | 209 | if ( !d->isRunning ) |
210 | return; | 210 | return; |
211 | 211 | ||
@@ -275,25 +275,25 @@ ChannelMessage::ChannelMessage( int type ) | |||
275 | } | 275 | } |
276 | 276 | ||
277 | ChannelMessage::~ChannelMessage() | 277 | ChannelMessage::~ChannelMessage() |
278 | { | 278 | { |
279 | if ( m_guard.isLocked() ) | 279 | if ( m_guard.isLocked() ) |
280 | m_guard.unlock(); | 280 | m_guard.unlock(); |
281 | } | 281 | } |
282 | 282 | ||
283 | void ChannelMessage::reply() | 283 | void ChannelMessage::reply() |
284 | { | 284 | { |
285 | if ( !m_isCall ) | 285 | if ( !m_isCall ) |
286 | { | 286 | { |
287 | qDebug( "ChannelMessage::reply() - can't reply oneway message!" ); | 287 | odebug << "ChannelMessage::reply() - can't reply oneway message!" << oendl; |
288 | return; | 288 | return; |
289 | } | 289 | } |
290 | 290 | ||
291 | if ( m_inEventHandler ) | 291 | if ( m_inEventHandler ) |
292 | { | 292 | { |
293 | m_replied = true; | 293 | m_replied = true; |
294 | return; | 294 | return; |
295 | } | 295 | } |
296 | 296 | ||
297 | m_condition.wakeOne(); | 297 | m_condition.wakeOne(); |
298 | m_guard.unlock(); | 298 | m_guard.unlock(); |
299 | } | 299 | } |