Changeset 498ced1 in mainline for uspace/srv/devman/fun.c


Ignore:
Timestamp:
2018-08-11T02:43:32Z (6 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/devman/fun.c

    rb13d80b r498ced1  
    6060
    6161        fun->state = FUN_INIT;
    62         atomic_set(&fun->refcnt, 0);
     62        refcount_init(&fun->refcnt);
    6363        fibril_mutex_initialize(&fun->busy_lock);
    6464        link_initialize(&fun->dev_functions);
     
    8989void fun_add_ref(fun_node_t *fun)
    9090{
    91         atomic_inc(&fun->refcnt);
     91        refcount_up(&fun->refcnt);
    9292}
    9393
     
    100100void fun_del_ref(fun_node_t *fun)
    101101{
    102         if (atomic_predec(&fun->refcnt) == 0)
     102        if (refcount_down(&fun->refcnt))
    103103                delete_fun_node(fun);
    104104}
Note: See TracChangeset for help on using the changeset viewer.