Lines Matching full:refcount
5 //! C header: [`include/linux/refcount.h`](srctree/include/linux/refcount.h)
16 /// [`include/linux/refcount.h`](srctree/include/linux/refcount.h).
20 pub struct Refcount(Opaque<bindings::refcount_t>); struct
22 impl Refcount { impl
23 /// Construct a new [`Refcount`] from an initial value.
39 /// Get the underlying atomic counter that backs the refcount.
42 /// `refcount.h`. If there is no way to achieve the result using APIs in `refcount.h`, then
53 /// Set a refcount's value.
60 /// Increment a refcount.
62 /// It will saturate if overflows and `WARN`. It will also `WARN` if the refcount is 0, as this
73 /// Decrement a refcount.
85 /// Decrement a refcount and test if it is 0.
93 /// Returns true if the resulting refcount is 0, false otherwise.
97 /// A common pattern of using `Refcount` is to free memory when the reference count reaches
98 /// zero. This means that the reference to `Refcount` could become invalid after calling this
99 /// function. This is fine as long as the reference to `Refcount` is no longer used when this
111 unsafe impl Send for Refcount {} implementation
114 unsafe impl Sync for Refcount {} implementation