At Mon, 12 May 2014 12:05:41 +0200, Justus Winter wrote: > +/* Decrement REF. Return the result of the operation. This function > + uses atomic operations. It is not required to serialize calls to > + this function. */ > +static inline unsigned int > +refcount_deref (refcount_t *ref) > +{ > + return __atomic_sub_fetch (ref, 1, __ATOMIC_RELAXED); > +}
How about adding assert(*ref >= 0)? :) Neal