Changes in kernel/generic/include/lib/refcount.h [09ab0a9a:95d45482] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/lib/refcount.h
r09ab0a9a 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.