angoyal
10-06-2004, 12:25 AM
sorry to ask this folks, but are dependent on InterlockedIncrement() returning a value.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/interlockedincrement.asp
Unfortunately, linux offers some calls in <asm/atomic.h> that are close, but do not quite meet our needs.
we wanted to use this: 93 static __inline__ void atomic_inc(atomic_t *v)
94 {
95 __asm__ __volatile__(
96 LOCK "incl %0"
97 :"=m" (v->counter)
98 :"m" (v->counter));
99 }
but as you can see, atomic_inc does not return a value (only void).
we looked at other functions in this file, but none of them do exactly what InterlockedIncrement does.
Can someone point me in the right direction?
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/interlockedincrement.asp
Unfortunately, linux offers some calls in <asm/atomic.h> that are close, but do not quite meet our needs.
we wanted to use this: 93 static __inline__ void atomic_inc(atomic_t *v)
94 {
95 __asm__ __volatile__(
96 LOCK "incl %0"
97 :"=m" (v->counter)
98 :"m" (v->counter));
99 }
but as you can see, atomic_inc does not return a value (only void).
we looked at other functions in this file, but none of them do exactly what InterlockedIncrement does.
Can someone point me in the right direction?