alsa-lib/src/seq
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
..
Makefile.am autotools: update style 2014-02-26 08:16:22 +01:00
seq.c conf: Add thread-safe global tree reference 2016-05-17 15:51:20 +02:00
seq_event.c Remove sequencer instrument layer 2007-10-30 12:31:55 +01:00
seq_hw.c seq: Provide sequencer sound card number / PID via alsa-lib 2016-03-08 10:57:18 +01:00
seq_local.h Merge kernel uapi/sound/asound.h and asequencer.h 2012-11-26 18:02:17 +01:00
seq_midi_event.c more midi_event documentation 2009-07-06 11:55:31 +02:00
seq_old.c Remove sequencer instrument layer 2007-10-30 12:31:55 +01:00
seq_symbols.c Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
seqmid.c seqmid: restore sequencer address prefix match feature 2013-05-13 21:16:36 +02:00