Changeset 6424800 in mainline for uspace/srv/audio/hound/hound.c


Ignore:
Timestamp:
2012-07-13T08:38:20Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ab07cf0
Parents:
1c33539
Message:

hound: Implement client removal

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/audio/hound/hound.c

    r1c33539 r6424800  
    201201}
    202202
     203int hound_remove_source(hound_t *hound, audio_source_t *source)
     204{
     205        assert(hound);
     206        if (!source)
     207                return EINVAL;
     208        log_verbose("Removing source '%s'.", source->name);
     209        fibril_mutex_lock(&hound->list_guard);
     210        if (!list_member(&source->link, &hound->sources)) {
     211                fibril_mutex_unlock(&hound->list_guard);
     212                return EBUSY;
     213        }
     214        list_remove(&source->link);
     215        fibril_mutex_unlock(&hound->list_guard);
     216        return EOK;
     217}
     218
     219int hound_remove_sink(hound_t *hound, audio_sink_t *sink)
     220{
     221        assert(hound);
     222        if (!sink)
     223                return EINVAL;
     224        log_verbose("Removing sink '%s'.", sink->name);
     225        fibril_mutex_lock(&hound->list_guard);
     226        if (!list_empty(&sink->sources)) {
     227                fibril_mutex_unlock(&hound->list_guard);
     228                return EBUSY;
     229        }
     230        list_remove(&sink->link);
     231        fibril_mutex_unlock(&hound->list_guard);
     232        return EOK;
     233}
     234
    203235int hound_connect(hound_t *hound, const char* source_name, const char* sink_name)
    204236{
Note: See TracChangeset for help on using the changeset viewer.