• Takashi Sakamoto's avatar
    ALSA: control: use counting semaphore as write lock for TLV write/command operations · 4c8099e9
    Takashi Sakamoto authored
    In ALSA control interface, applications can execute three types of request
    for Type-Length-Value (TLV) data to a set of elements; read, write and
    command. In ALSA control core, all of the requests are handled within read
    lock to a counting semaphore, therefore several processes can run to access
    to the data at the same time for any purposes. This has an issue because
    write and command requests have side effect to change state of a set of
    elements for the TLV data. Concurrent access should be controlled for each
    of reference/change case.
    
    This commit uses the counting semaphore as read lock for TLV read requests,
    while use it as write lock for TLV write/command requests. The state of a
    set of elements for the TLV data is maintained exclusively between read
    requests and write/command requests, or between write and command requests.
    Signed-off-by: default avatarTakashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
    4c8099e9
control.c 49.8 KB