| #include <linux/kthread.h> |
| DECLARE_WAIT_QUEUE_HEAD(speakup_event); |
| EXPORT_SYMBOL_GPL(speakup_event); |
| int speakup_thread(void *data) |
| spin_lock_irqsave(&speakup_info.spinlock, flags); |
| our_sound = spk_unprocessed_sound; |
| spk_unprocessed_sound.active = 0; |
| prepare_to_wait(&speakup_event, &wait, |
| should_break = kthread_should_stop() || |
| (synth && synth->catch_up && synth->alive && |
| (speakup_info.flushing || |
| spin_unlock_irqrestore(&speakup_info.spinlock, flags); |
| mutex_unlock(&spk_mutex); |
| finish_wait(&speakup_event, &wait); |
| if (kthread_should_stop()) |
| kd_mksound(our_sound.freq, our_sound.jiffies); |
| if (synth && synth->catch_up && synth->alive) { |
| * It is up to the callee to take the lock, so that it |
| * can sleep whenever it likes |
| mutex_unlock(&spk_mutex); |