On Tue, Mar 18, 2014 at 01:26:12AM -0700, noman pouigt wrote:
> Hello,
>
> I looked through the documentation for atomic
> operations but couldn't find out the api for following
> operation:
>
> x = 1;
> temp = atomic_read_increment(x);
>
> so basically this will read the old value of x in temp
noman pouigt wrote:
> x = 1;
> temp = atomic_read_increment(x);
atomic_set(&x, 1);
temp = atomic_inc_return(&x);
> I looked through the documentation for atomic
> operations but couldn't find out the api
Not everything is fully documented.
Look through include/asm-generic/atomic.h.
Regards,
C
Hello,
I looked through the documentation for atomic
operations but couldn't find out the api for following
operation:
x = 1;
temp = atomic_read_increment(x);
so basically this will read the old value of x in temp
and then increment x.
so temp = 1 and x = 2.
Is this api already available?
Tha
3 matches
Mail list logo