>#ifdef __KERNEL__ > >#define ATOMIC_INIT(i) { (i) } > >#define atomic_read(v) ((v)->counter) >#define atomic_set(v,i) (((v)->counter) = (i)) > > >etc. > >Not using atomic reads where they are necessary would seem like a bad >idea. Are the ones in pcm_meter (and maybe they are used elsewhere) >really necessary? And if they are, shouldn't that code be kernel side? >Or is there a different way to do it in userland?
the macros in asm/atomic.h are perfectly usable from user space. however, atomic.h is a *kernel header*, and linus has made it very clear that no user space program should ever include these headers. the solution is quite simple (and the one he advocates): copy the contents of the header file to a new location and use that. most of my code includes <pbd/atomic.h> which contains a copy of the relevant stuff for several linux architectures. --p _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel