* ref_put * decrement reference counter for object. * If the reference counter is zero, call release(). * * Return 1 means the object's reference counter is zero and release() is called. */
| 52 | * Return 1 means the object's reference counter is zero and release() is called. |
| 53 | */ |
| 54 | rt_inline int rt_ref_put(struct rt_ref *r, void (*release)(struct rt_ref *r)) |
| 55 | { |
| 56 | if (rt_atomic_dec_and_test(&r->refcount)) |
| 57 | { |
| 58 | release(r); |
| 59 | |
| 60 | return 1; |
| 61 | } |
| 62 | |
| 63 | return 0; |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * ref_get_unless_zero - Increment refcount for object unless it is zero. |
no test coverage detected