Re: atomic read and increment question

2014-03-18 Thread Paul E. McKenney
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

Re: atomic read and increment question

2014-03-18 Thread Clemens Ladisch
noman pouigt wrote: > x = 1; > temp = atomic_read_increment(x); atomic_set(, 1); temp = atomic_inc_return(); > 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,

atomic read and increment question

2014-03-18 Thread noman pouigt
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?

atomic read and increment question

2014-03-18 Thread noman pouigt
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?

Re: atomic read and increment question

2014-03-18 Thread Clemens Ladisch
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,

Re: atomic read and increment question

2014-03-18 Thread Paul E. McKenney
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 and then