|
|
@@ -208,12 +208,15 @@ static ssize_t softsynthx_read(struct file *fp, char __user *buf, size_t count,
|
|
|
return -EINVAL;
|
|
|
|
|
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
|
|
+ synth_soft.alive = 1;
|
|
|
while (1) {
|
|
|
prepare_to_wait(&speakup_event, &wait, TASK_INTERRUPTIBLE);
|
|
|
- if (!unicode)
|
|
|
- synth_buffer_skip_nonlatin1();
|
|
|
- if (!synth_buffer_empty() || speakup_info.flushing)
|
|
|
- break;
|
|
|
+ if (synth_current() == &synth_soft) {
|
|
|
+ if (!unicode)
|
|
|
+ synth_buffer_skip_nonlatin1();
|
|
|
+ if (!synth_buffer_empty() || speakup_info.flushing)
|
|
|
+ break;
|
|
|
+ }
|
|
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
|
|
if (fp->f_flags & O_NONBLOCK) {
|
|
|
finish_wait(&speakup_event, &wait);
|
|
|
@@ -233,6 +236,8 @@ static ssize_t softsynthx_read(struct file *fp, char __user *buf, size_t count,
|
|
|
|
|
|
/* Keep 3 bytes available for a 16bit UTF-8-encoded character */
|
|
|
while (chars_sent <= count - bytes_per_ch) {
|
|
|
+ if (synth_current() != &synth_soft)
|
|
|
+ break;
|
|
|
if (speakup_info.flushing) {
|
|
|
speakup_info.flushing = 0;
|
|
|
ch = '\x18';
|
|
|
@@ -329,7 +334,8 @@ static __poll_t softsynth_poll(struct file *fp, struct poll_table_struct *wait)
|
|
|
poll_wait(fp, &speakup_event, wait);
|
|
|
|
|
|
spin_lock_irqsave(&speakup_info.spinlock, flags);
|
|
|
- if (!synth_buffer_empty() || speakup_info.flushing)
|
|
|
+ if (synth_current() == &synth_soft &&
|
|
|
+ (!synth_buffer_empty() || speakup_info.flushing))
|
|
|
ret = EPOLLIN | EPOLLRDNORM;
|
|
|
spin_unlock_irqrestore(&speakup_info.spinlock, flags);
|
|
|
return ret;
|