1 #include <linux/kthread.h>
2 #include <linux/wait.h>
8 DECLARE_WAIT_QUEUE_HEAD(speakup_event
);
9 EXPORT_SYMBOL_GPL(speakup_event
);
11 int speakup_thread(void *data
)
15 struct bleep our_sound
;
19 our_sound
.jiffies
= 0;
21 mutex_lock(&spk_mutex
);
26 our_sound
= unprocessed_sound
;
27 unprocessed_sound
.active
= 0;
28 prepare_to_wait(&speakup_event
, &wait
, TASK_INTERRUPTIBLE
);
29 should_break
= kthread_should_stop() ||
31 (synth
&& synth
->catch_up
&& synth
->alive
&&
32 (speakup_info
.flushing
||
33 !synth_buffer_empty()));
37 mutex_unlock(&spk_mutex
);
39 mutex_lock(&spk_mutex
);
41 finish_wait(&speakup_event
, &wait
);
42 if (kthread_should_stop())
45 if (our_sound
.active
) {
46 kd_mksound(our_sound
.freq
, our_sound
.jiffies
);
48 if (synth
&& synth
->catch_up
&& synth
->alive
) {
49 /* It is up to the callee to take the lock, so that it
50 * can sleep whenever it likes */
51 synth
->catch_up(synth
);
56 mutex_unlock(&spk_mutex
);
This page took 0.032494 seconds and 5 git commands to generate.