Misc fixes and race condition cleaning

This commit is contained in:
Abramo Bagnara 2000-10-15 14:15:30 +00:00
parent 633815a591
commit d5c49aaa8e
6 changed files with 295 additions and 283 deletions

View file

@ -47,6 +47,12 @@ int snd_pcm_close(snd_pcm_t *pcm)
int ret = 0;
int err;
assert(pcm);
if (pcm->valid_setup) {
if (pcm->mode & SND_PCM_NONBLOCK)
snd_pcm_drop(pcm);
else
snd_pcm_drain(pcm);
}
if (pcm->mmap_info) {
if ((err = snd_pcm_munmap(pcm)) < 0)
ret = err;