Diffstat (limited to 'noncore/multimedia/opieplayer2/threadutil.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/threadutil.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/threadutil.cpp b/noncore/multimedia/opieplayer2/threadutil.cpp index b5cac61..5fc8a0b 100644 --- a/noncore/multimedia/opieplayer2/threadutil.cpp +++ b/noncore/multimedia/opieplayer2/threadutil.cpp | |||
@@ -224,30 +224,35 @@ bool Thread::wait() | |||
224 | 224 | ||
225 | bool Thread::isRunning() const | 225 | bool Thread::isRunning() const |
226 | { | 226 | { |
227 | AutoLock lock( d->guard ); | 227 | AutoLock lock( d->guard ); |
228 | return d->isRunning; | 228 | return d->isRunning; |
229 | } | 229 | } |
230 | 230 | ||
231 | void Thread::exit() | 231 | void Thread::exit() |
232 | { | 232 | { |
233 | pthread_exit( 0 ); | 233 | pthread_exit( 0 ); |
234 | } | 234 | } |
235 | 235 | ||
236 | OnewayNotifier::OnewayNotifier() | 236 | OnewayNotifier::OnewayNotifier() : |
237 | m_readFd(-1), | ||
238 | m_writeFd(-1) | ||
237 | { | 239 | { |
238 | int fds[ 2 ]; | 240 | int fds[ 2 ] = { -1, -1 }; |
239 | pipe( fds ); | 241 | if (pipe( fds ) == 0) { |
240 | m_readFd = fds[ 0 ]; | 242 | m_readFd = fds[ 0 ]; |
241 | m_writeFd = fds[ 1 ]; | 243 | m_writeFd = fds[ 1 ]; |
244 | } else { | ||
245 | owarn << "Call to pipe() failed" << oendl; | ||
246 | } | ||
242 | 247 | ||
243 | m_notifier = new QSocketNotifier( m_readFd, QSocketNotifier::Read ); | 248 | m_notifier = new QSocketNotifier( m_readFd, QSocketNotifier::Read ); |
244 | connect( m_notifier, SIGNAL( activated(int) ), | 249 | connect( m_notifier, SIGNAL( activated(int) ), |
245 | this, SLOT( wakeUp() ) ); | 250 | this, SLOT( wakeUp() ) ); |
246 | } | 251 | } |
247 | 252 | ||
248 | OnewayNotifier::~OnewayNotifier() | 253 | OnewayNotifier::~OnewayNotifier() |
249 | { | 254 | { |
250 | delete m_notifier; | 255 | delete m_notifier; |
251 | 256 | ||
252 | ::close( m_readFd ); | 257 | ::close( m_readFd ); |
253 | ::close( m_writeFd ); | 258 | ::close( m_writeFd ); |