8 Jan
2018
8 Jan
'18
4:35 p.m.
On 01/08/2018 03:25 PM, Takashi Iwai wrote:
@@ -1438,8 +1441,11 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use
if ((tmp = snd_pcm_oss_make_ready(substream)) < 0) return tmp;
- mutex_lock(&runtime->oss.params_lock); while (bytes > 0) {
if (mutex_lock_interruptible(&runtime->oss.params_lock)) {
tmp = -EINTR;
For consistency ERESTARTSYS I guess? In the end this is the same as signal_pending().
break;
if (bytes < runtime->oss.period_bytes || runtime->oss.buffer_used > 0) { if (runtime->oss.buffer_used == 0) { tmp = snd_pcm_oss_read2(substream, runtime->oss.buffer, runtime->oss.period_bytes, 1);}
@@ -1470,16 +1476,16 @@ static ssize_t snd_pcm_oss_read1(struct snd_pcm_substream *substream, char __use bytes -= tmp; xfer += tmp; }
- err:
mutex_unlock(&runtime->oss.params_lock);
if (tmp < 0)
if (signal_pending(current)) { tmp = -ERESTARTSYS;break;
goto err;
}break;
}tmp = 0;
- mutex_unlock(&runtime->oss.params_lock);
- return xfer;
- err:
- mutex_unlock(&runtime->oss.params_lock); return xfer > 0 ? (snd_pcm_sframes_t)xfer : tmp;
}