Changeset 498ced1 in mainline for uspace/lib/usbhost/src/endpoint.c
- Timestamp:
- 2018-08-11T02:43:32Z (7 years ago)
- 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)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/endpoint.c
rb13d80b r498ced1 36 36 37 37 #include <assert.h> 38 #include <atomic.h>39 38 #include <mem.h> 40 39 #include <stdlib.h> … … 60 59 ep->device = dev; 61 60 62 atomic_set(&ep->refcnt, 0);61 refcount_init(&ep->refcnt); 63 62 fibril_condvar_initialize(&ep->avail); 64 63 … … 91 90 void endpoint_add_ref(endpoint_t *ep) 92 91 { 93 atomic_inc(&ep->refcnt);92 refcount_up(&ep->refcnt); 94 93 } 95 94 … … 115 114 void endpoint_del_ref(endpoint_t *ep) 116 115 { 117 if ( atomic_predec(&ep->refcnt) == 0) {116 if (refcount_down(&ep->refcnt)) 118 117 endpoint_destroy(ep); 119 }120 118 } 121 119
Note:
See TracChangeset
for help on using the changeset viewer.