Traditionally, many of ALSA library functions are supposed to be
thread-unsafe, and applications are required to take care of thread
safety by themselves. However, people never be careful enough, and
almost all applications fail in this regard.
This patch is an attempt to harden the thread safety in exported PCM
functions in a simplistic way: just wrap some of exported functions
with the pthread mutex of each PCM object. Not all API functions are
wrapped by the mutex since it doesn't make sense. Instead, the
patchset covers only the functions that may be likely called
concurrently. The supposedly thread-safe API functions are marked in
the document.
For achieving the feature, two new fields are added snd_pcm_t when the
option is enabled: thread_safe and lock. The former indicates that
the plugin is thread-safe that doesn't need this workaround and the
latter is the pthread mutex. Currently only hw plugin have
thread_safe=1. So, the most of real-time sensitive apps won't be
influenced by this patchset.
Although the patch covers most of PCM ops, a few snd_pcm_fast_ops are
left without the extra mutex locking: namely, the ones that may have
blocking behavior, i.e. resume, drain, readi, writei, readn and
writen. These are supposed to handle own locking in the callbacks.
Also, if anyone wants to disable this new thread-safe API feature, it
can be still turned off via --disable-thread-safety configure option.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This is really just nitpick, but it annoyed me for a few seconds, so I thought
I'd just fix it.
In d7534b2cee (hgcompile -> gitcompile) the filename was updated but
INSTALL was not, leaving outdated docs.
Signed-off-by: Henrik Austad <henrik@austad.us>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Simplest way to configure cross-compilation with configure
script is to pass '--host' option.
Passing just '--target' doesn't work.
Signed-off-by: Dmitry Voytik <voytikd@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
include/sound directory, so that alsa-lib can be compiled without
alsa-driver.
with this addition, --with-kernel and --with-soundbase options are
removed from configure. they are obviously unnecessary.
the relevant parts in INSTALL are removed/modified.