alsa-lib/include
Takashi Iwai c9a0d7d601 conf: Add thread-safe global tree reference
Most of open functions in alsa-lib have the call pattern:
  snd_config_update();
  return snd_xxx_open(x, snd_config, ...);

This means that the toplevel config gets updated, and passed to a
local open function.  Although snd_config_update() itself has a
pthread mutex to be thread safe, the whole procedure above isn't
thread safe.  Namely, the global snd_config tree may be deleted and
recreated at any time while the open function is being processed.
This may lead to a data corruption and crash of the program.

For avoiding the corruption, this patch introduces a refcount to
config tree object.  A few new helper functions are introduced as
well:
- snd_config_update_ref() does update and take the refcount of the
  toplevel tree.   The obtained config tree has to be freed via
  snd_config_unref() below.
- snd_config_ref() and snd_config_unref() manage the refcount of the
  config object.  The latter eventually deletes the object when all
  references are gone.

Along with these additions, the caller of snd_config_update() and
snd_config global tree in alsa-lib are replaced with the new helpers.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2016-05-17 15:51:20 +02:00
..
sound topology: Fix pcm ID & name parsing 2016-05-09 10:30:40 +02:00
alisp.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
alsa-symbols.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
aserver.h Remove unused hostname resolution in shm plugins and aserver 2015-01-28 16:23:06 +01:00
asoundef.h IEC958 definition for consumer status channel update 2008-08-01 13:17:52 +02:00
asoundlib-head.h Portability fix: look for sys/endian.h as well as endian.h 2014-02-24 11:00:53 +01:00
asoundlib-tail.h Create asoundlib.h dynamically according to configure options 2007-07-10 15:58:41 +02:00
bswap.h Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
conf.h conf: Add thread-safe global tree reference 2016-05-17 15:51:20 +02:00
control.h Use __inline__ for exported headers 2013-04-25 09:52:33 +02:00
control_external.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
error.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
global.h include/global.h - don't define timeval and timespec structures for !glibc 2013-11-08 12:34:44 +01:00
hwdep.h hwdep: add FireWire digi00x/tascam driver support 2015-10-05 23:43:29 +02:00
iatomic.h alsa-lib: heavy pcm atomics cleanup 2014-02-11 13:45:16 +01:00
input.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
list.h Replace list.h with its own version 2015-07-27 12:39:54 +02:00
local.h Define some types if missing 2016-03-03 10:59:52 +01:00
Makefile.am Introduce bswap.h for portable definitions of byte swap macros. 2016-03-03 16:18:10 +01:00
mixer.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
mixer_abst.h implemented integer volume <-> dB volume conversion functions for simple mixer 2008-04-21 11:44:20 +02:00
output.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
pcm.h pcm: Fix doxygen for two enums 2015-08-24 22:26:11 +02:00
pcm_external.h Fix documentation of external PCM plugin SDK 2005-05-24 09:42:01 +00:00
pcm_extplug.h Use __inline__ for exported headers 2013-04-25 09:52:33 +02:00
pcm_ioplug.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
pcm_old.h Move old PCM API to pcm_old.h 2005-04-14 14:01:10 +00:00
pcm_plugin.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
pcm_rate.h Query the supported rate ranges from rate plugins 2009-06-02 16:26:03 +02:00
rawmidi.h Remove assert from header files 2007-10-25 15:36:03 +02:00
search.h Corrections by Kevin Conder <kconder@interaccess.com> 2002-03-12 20:14:33 +00:00
seq.h seq: Provide sequencer sound card number / PID via alsa-lib 2016-03-08 10:57:18 +01:00
seq_event.h all places: doxygen cleanups 2013-04-08 16:42:24 +02:00
seq_midi_event.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
seqmid.h Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
sys.h Ok, added warning to sys/asoundlib.h with redirection to alsa/asoundlib.h. 2001-09-11 12:18:56 +00:00
timer.h Defined symbols exposing the hrtimer to applications. 2009-11-08 09:21:56 +01:00
topology.h topology: Parse front-end DAI name and ID for the PCM 2016-05-09 10:30:40 +02:00
type_compat.h Add more compatibility defines. 2016-03-03 16:18:54 +01:00
use-case.h ucm: docs: Fix doxygen formatting for UCM main page. 2015-06-29 17:44:00 +02:00