Changeset c05642d in mainline for uspace/lib/c/generic/async.c


Ignore:
Timestamp:
2011-09-07T00:03:26Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5081276
Parents:
bb74dabe (diff), 038b289 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async.c

    rbb74dabe rc05642d  
    17771777int async_hangup(async_sess_t *sess)
    17781778{
     1779        async_exch_t *exch;
     1780       
    17791781        assert(sess);
    17801782       
    17811783        if (atomic_get(&sess->refcnt) > 0)
    17821784                return EBUSY;
     1785       
     1786        fibril_mutex_lock(&async_sess_mutex);
    17831787       
    17841788        int rc = async_hangup_internal(sess->phone);
    17851789        if (rc == EOK)
    17861790                free(sess);
     1791       
     1792        while (!list_empty(&sess->exch_list)) {
     1793                exch = (async_exch_t *)
     1794                    list_get_instance(list_first(&sess->exch_list),
     1795                    async_exch_t, sess_link);
     1796               
     1797                list_remove(&exch->sess_link);
     1798                list_remove(&exch->global_link);
     1799                async_hangup_internal(exch->phone);
     1800                free(exch);
     1801        }
     1802       
     1803        fibril_mutex_unlock(&async_sess_mutex);
    17871804       
    17881805        return rc;
Note: See TracChangeset for help on using the changeset viewer.