stream = adap->channel.stream->stream;
for (;;) {
+ if (adap->feed_thread_stop) break;
if (kthread_should_stop()) break;
/* Not sure about this... */
}
- /* Wait until more buffers become available. */
+ /* Wait until more buffers become available or we're
+ told not to wait any longer. */
ret = wait_event_interruptible(
adap->buffer_wait_data,
- pvr2_stream_get_ready_count(stream) > 0);
+ (pvr2_stream_get_ready_count(stream) > 0) ||
+ adap->feed_thread_stop);
if (ret < 0) break;
}
struct pvr2_stream *stream;
if (adap->thread) {
+ adap->feed_thread_stop = !0;
+ pvr2_dvb_notify(adap);
kthread_stop(adap->thread);
adap->thread = NULL;
}
if (ret < 0) return ret;
}
+ adap->feed_thread_stop = 0;
adap->thread = kthread_run(pvr2_dvb_feed_thread, adap, "pvrusb2-dvb");
if (IS_ERR(adap->thread)) {