]> git.alsa-project.org Git - alsa-lib.git/commitdiff
pcm: Do not access lock_enabled if thread safe API
authorTimo Wischer <twischer@de.adit-jv.com>
Thu, 1 Mar 2018 16:34:44 +0000 (17:34 +0100)
committerTakashi Iwai <tiwai@suse.de>
Thu, 1 Mar 2018 17:01:36 +0000 (18:01 +0100)
Without this commit compiling fails when THREAD_SAFE_API is not
enabled.

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

index 1be38339c450412bfffb06311fcd06d9a7797ea8..d53ed986804ef9d96d47654e54568bb45eb79b16 100644 (file)
@@ -823,8 +823,11 @@ int snd_pcm_async(snd_pcm_t *pcm, int sig, pid_t pid)
                sig = SIGIO;
        if (pid == 0)
                pid = getpid();
+
+#ifdef THREAD_SAFE_API
        /* async handler may lead to a deadlock; suppose no multi thread */
        pcm->lock_enabled = 0;
+#endif
        return pcm->ops->async(pcm->op_arg, sig, pid);
 }
 #endif