All of lore.kernel.org
 help / color / mirror / Atom feed
From: <twischer@de.adit-jv.com>
To: patch@alsa-project.org
Cc: Timo Wischer <twischer@de.adit-jv.com>, alsa-devel@alsa-project.org
Subject: [PATCH - THREAD_SAFE_API 1/1] pcm: Do not access lock_enabled if thread safe API
Date: Thu, 1 Mar 2018 17:34:44 +0100	[thread overview]
Message-ID: <1519922084-6954-1-git-send-email-twischer@de.adit-jv.com> (raw)

From: Timo Wischer <twischer@de.adit-jv.com>

is not enabled.
Without this commit compiling fails when THREAD_SAFE_API is not enabled

Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>

diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c
index 1be3833..d53ed98 100644
--- a/src/pcm/pcm.c
+++ b/src/pcm/pcm.c
@@ -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
-- 
2.7.4

             reply	other threads:[~2018-03-01 16:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-01 16:34 twischer [this message]
2018-03-01 17:02 ` [PATCH - THREAD_SAFE_API 1/1] pcm: Do not access lock_enabled if thread safe API Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1519922084-6954-1-git-send-email-twischer@de.adit-jv.com \
    --to=twischer@de.adit-jv.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=patch@alsa-project.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.