From: Takashi Iwai Subject: Re: [patch] snd_pcm_dmix_close: raise semaphore if unable to discard Date: Thu, 18 Oct 2007 10:23:56 +0200 Message-ID: References: Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id A07C4246D9 for ; Thu, 18 Oct 2007 11:11:03 +0200 (CEST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Mike Gorse Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 17 Oct 2007 20:55:11 -0400 (EDT), Mike Gorse wrote: > > This patch causes snd_pcm_dmix_close() to up a semaphore after downing it > if it is unable to discard it. It prevents some deadlock that I am > getting when a couple of applications interact and one of them closes the > device and later re-opens it. Thanks, applied to HG tree now. Takashi > > -- > > --- src/pcm/pcm_dmix.c.orig 2007-10-17 20:19:47.000000000 -0400 > +++ src/pcm/pcm_dmix.c 2007-10-17 20:50:46.000000000 -0400 > @@ -652,8 +652,11 @@ > if (dmix->client) > snd_pcm_direct_client_discard(dmix); > shm_sum_discard(dmix); > - if (snd_pcm_direct_shm_discard(dmix)) > - snd_pcm_direct_semaphore_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); > + } > + } > else > snd_pcm_direct_semaphore_up(dmix, DIRECT_IPC_SEM_CLIENT); > free(dmix->bindings); > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >