mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-06 13:29:59 -05:00
pcm: direct plugins: do more safe IPC semaphore handling
As reported dead-lock, do local lock counting and invoke abort() when the lock counts do not match at close() time. Reported-by: <mateen abdulmateen.shaikh@gmail.com> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
b6eb0f9bfd
commit
a6813c2d0e
4 changed files with 28 additions and 12 deletions
|
|
@ -781,9 +781,9 @@ static int snd_pcm_dmix_close(snd_pcm_t *pcm)
|
|||
shm_sum_discard(dmix);
|
||||
if (snd_pcm_direct_shm_discard(dmix)) {
|
||||
if (snd_pcm_direct_semaphore_discard(dmix))
|
||||
snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT);
|
||||
snd_pcm_direct_semaphore_final(dmix, DIRECT_IPC_SEM_CLIENT);
|
||||
} else
|
||||
snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT);
|
||||
snd_pcm_direct_semaphore_final(dmix, DIRECT_IPC_SEM_CLIENT);
|
||||
free(dmix->bindings);
|
||||
pcm->private_data = NULL;
|
||||
free(dmix);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue