Re: [lttng-dev] [PATCH lttng-modules] Fix: atomic_add_unless() returns true/false rather than prior value

2017-03-08 Thread Mathieu Desnoyers
- On Mar 8, 2017, at 11:38 AM, Francis Deslauriers francis.deslauri...@efficios.com wrote: > The previous implementation assumed that `atomic_add_unless` returned the > prior value of the atomic counter when in fact it returned if addition was > successful(true) or overflowed(false). I

[lttng-dev] [PATCH lttng-modules] Fix: atomic_add_unless() returns true/false rather than prior value

2017-03-08 Thread Francis Deslauriers
The previous implementation assumed that `atomic_add_unless` returned the prior value of the atomic counter when in fact it returned if addition was successful(true) or overflowed(false). Since `atomic_add_unless` can not return INT_MAX, the `lttng_kref_get` always returned that the call was