Changeset 8526e585 in mainline


Ignore:
Timestamp:
2011-01-25T23:37:18Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
23882034
Parents:
46eec3b
Message:

Reorder call to the client data destructor so that it can be more
flexible.

File:
1 edited

Legend:

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

    r46eec3b r8526e585  
    541541        client_t *cl;
    542542        link_t *lnk;
    543         void *unref_client_data = NULL;
     543        bool destroy = false;
    544544
    545545        /*
     
    587587        if (--cl->refcnt == 0) {
    588588                hash_table_remove(&client_hash_table, &key, 1);
    589                 unref_client_data = cl->data;
     589                destroy = true;
     590        }
     591        futex_up(&async_futex);
     592
     593        if (destroy) {
     594                if (cl->data)
     595                        async_client_data_destroy(cl->data);
    590596                free(cl);
    591597        }
    592         futex_up(&async_futex);
    593 
    594         if (unref_client_data)
    595                 async_client_data_destroy(unref_client_data);
    596598
    597599        /*
Note: See TracChangeset for help on using the changeset viewer.