[LAD] Atomic Operations

Olivier Guilyardi list at samalyse.com
Thu Dec 17 17:04:11 UTC 2009


On 12/17/2009 04:00 PM, Tim Goetze wrote:
> [Olivier Guilyardi]
> 
>> On 12/17/2009 01:03 PM, Tim Blechmann wrote:
>>>> +#if defined(__APPLE__)
>>>> +#include <libkern/OSAtomic.h>
>>>> +#define MEMORY_BARRIER() OSMemoryBarrier()
>>>> +#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)
>>>> +#define MEMORY_BARRIER() __sync_synchronize()
>>>> +#else
>>>> +#warning SMP Danger: memory barriers are not supported on this system
>>>> +#endif
> 
> I may be wrong but if neither __APPLE__ nor __GNUC__ >= 4.1 are true
> shouldn't MEMORY_BARRIER() at least be an empty define to keep cpp 
> happy?  
> 
> After all, your #warning statement seems to indicate you don't want 
> compilation to fail.

Yes indeed. Fixed.

--
  Olivier



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: ringbuffer-mb.diff
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091217/a07155df/attachment.ksh>


More information about the Linux-audio-dev mailing list