lkml.org 
[lkml]   [2008]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH, RFC] percpu_counters: make fbc->count read atomic on 32 bit architecture
Peter Zijlstra wrote:
....
> +static inline int atomic64_dec_and_test(atomic64_t *v)
> +{
> + int ret;
> +
> + write_seqlock(&v->slock);
> + v->counter--;
> + ret = !v->counter;
> + write_sequnlock(&v->slock);
> +
> + return ret;
> +}
> +
> +static inline int atomic64_add_and_test(atomic64_t *v)
> +{
> + int ret;
> +
> + write_seqlock(&v->slock);
> + v->counter++;
> + ret = !v->counter;
> + write_sequnlock(&v->slock);
> +
> + return ret;
> +}
would it be more logical to call this atomic64_inc_and_test to match the
above dec_and_test ?

regards
Richard


\
 
 \ /
  Last update: 2008-10-07 19:13    [W:0.061 / U:6.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site