OSDN Git Service

ALSA: pcm: Use recursive mutex
authorTakashi Iwai <tiwai@suse.de>
Fri, 21 Apr 2017 18:36:40 +0000 (20:36 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 21 Apr 2017 18:36:40 +0000 (20:36 +0200)
commit1cb217ead9aff029f194208bf484be1ba956b194
treee160aea9ed8483d8f5048acaa5e1b44db29e089a
parentfbc18ec77179bd975b58d93716be6cac58d51169
ALSA: pcm: Use recursive mutex

The recent thread-safety pthread implementation caused deadlocks in
some situations, e.g. when an external plugin calls snd_pcm_state() in
its callback.  One can avoid the deadlock by carefully using the
unlocked version, but it's often error-prone, and it might be still
problem with the old binaries.

In this patch, we initialize the pthread mutex as recursive for fixing
such a problem.

Suggested-by: Timo Wischer <twischer@de.adit-jv.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm.c