Changeset 498ced1 in mainline for uspace/lib/usbhost
- 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)
- Location:
- uspace/lib/usbhost
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/endpoint.h
rb13d80b r498ced1 42 42 43 43 #include <adt/list.h> 44 #include <atomic.h>45 44 #include <fibril_synch.h> 45 #include <refcount.h> 46 46 #include <stdbool.h> 47 47 #include <sys/time.h> … … 78 78 device_t *device; 79 79 /** Reference count. */ 80 atomic_ t refcnt;80 atomic_refcount_t refcnt; 81 81 82 82 /** An inherited guard */ -
uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
rb13d80b r498ced1 38 38 #define LIBUSBHOST_HOST_USB_TRANSFER_BATCH_H 39 39 40 #include <atomic.h>41 40 #include <errno.h> 41 #include <refcount.h> 42 42 #include <stddef.h> 43 43 #include <stdint.h> -
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.