]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: Better understandable locking code
authorTakashi Iwai <tiwai@suse.de>
Thu, 1 Sep 2016 12:05:00 +0000 (14:05 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 2 Sep 2016 08:13:48 +0000 (10:13 +0200)
commit0fc4b4d17bfd0ce44394f6040e1d5f9dfa97a5ad
tree6aaa0ce1209f0e62dfb812c250d19843bb839744
parent3b08152f68b0215474f5fc2d18681d6597a77a3c
pcm: Better understandable locking code

The newly added locking code seems to have confused quite a few
people, as "thread_safe=1" may be considered as if the thread-safety
lock has to be turned on.  (It meant that the plugin _is_ thread-safe,
i.e. it needs no extra locking.)

For avoiding such a misunderstanding, this commit renames the relevant
pcm fields and give more comments to explain what is for what.
The former single pcm->thread_safe flag is now split to two boolean
flags, pcm->need_lock and pcm->lock_enabled.  It consumes a few more
bytes, but this would be (hopefully) better understandable.

No functional change by this commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/pcm/pcm.c
src/pcm/pcm_hw.c
src/pcm/pcm_local.h