Changeset 498ced1 in mainline for uspace/srv/net/udp/assoc.c


Ignore:
Timestamp:
2018-08-11T02:43:32Z (7 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
05882233
Parents:
b13d80b
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:29:02)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-08-11 02:43:32)
Message:

Unify reference counting and remove some unnecessary instances of <atomic.h>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/udp/assoc.c

    rb13d80b r498ced1  
    9191
    9292        /* One for the user */
    93         atomic_set(&assoc->refcnt, 1);
     93        refcount_init(&assoc->refcnt);
    9494
    9595        /* Initialize receive queue */
     
    145145{
    146146        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: upd_assoc_addref(%p)", assoc->name, assoc);
    147         atomic_inc(&assoc->refcnt);
     147        refcount_up(&assoc->refcnt);
    148148}
    149149
     
    158158        log_msg(LOG_DEFAULT, LVL_DEBUG, "%s: udp_assoc_delref(%p)", assoc->name, assoc);
    159159
    160         if (atomic_predec(&assoc->refcnt) == 0)
     160        if (refcount_down(&assoc->refcnt))
    161161                udp_assoc_free(assoc);
    162162}
Note: See TracChangeset for help on using the changeset viewer.