Changeset 95d45482 in mainline for kernel/generic/include/lib/refcount.h
- Timestamp:
- 2018-11-09T22:29:12Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be6e37a
- Parents:
- 436a0a5
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-08 23:08:28)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-11-09 22:29:12)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/lib/refcount.h
r436a0a5 r95d45482 64 64 static inline void refcount_up(atomic_refcount_t *rc) 65 65 { 66 // XXX: We can use relaxed operation because acquiring a reference67 // implies no ordering relationships. A reference-counted object68 // still needs to be synchronized independently of the refcount.66 // NOTE: We can use relaxed operation because acquiring a reference 67 // implies no ordering relationships. A reference-counted object 68 // still needs to be synchronized independently of the refcount. 69 69 70 70 int old = atomic_fetch_add_explicit(&rc->__cnt, 1, … … 96 96 static inline bool refcount_down(atomic_refcount_t *rc) 97 97 { 98 // XXX: The decrementers don't need to synchronize with each other,99 // but they do need to synchronize with the one doing deallocation.98 // NOTE: The decrementers don't need to synchronize with each other, 99 // but they do need to synchronize with the one doing deallocation. 100 100 int old = atomic_fetch_sub_explicit(&rc->__cnt, 1, 101 101 memory_order_release); … … 104 104 105 105 if (old == 0) { 106 // XXX: We are holding the last reference, so we must now107 // synchronize with all the other decrementers.106 // NOTE: We are holding the last reference, so we must now 107 // synchronize with all the other decrementers. 108 108 109 109 int val = atomic_load_explicit(&rc->__cnt,
Note:
See TracChangeset
for help on using the changeset viewer.