Differences From Artifact [a4f95ba0da]:
- File
src/atomic.h
— part of check-in
[c5ef582958]
at
2013-03-04 17:20:15
on branch trunk
— Replace BOOL with bool.
The only places where BOOL is left are those where they are required by
the ABI. (user: js, size: 15322) [annotate] [blame] [check-ins using]
To Artifact [d4ea46f231]:
- File src/atomic.h — part of check-in [27138ee85b] at 2013-03-14 19:25:48 on branch trunk — Add a few memory barriers. (user: js, size: 16091) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
753 754 755 756 757 758 759 | return __sync_bool_compare_and_swap(p, o, n); #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwapPtrBarrier(o, n, p); #else # error No atomic operations available! #endif } | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 | return __sync_bool_compare_and_swap(p, o, n); #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwapPtrBarrier(o, n, p); #else # error No atomic operations available! #endif } static OF_INLINE void of_memory_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) __asm__ __volatile__ ( "mfence" ); #elif defined(OF_HAVE_GCC_ATOMIC_OPS) __sync_synchronize(); #elif defined(OF_HAVE_OSATOMIC) OSMemoryBarrier(); #else # error No atomic operations available! #endif } static OF_INLINE void of_memory_read_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) __asm__ __volatile__ ( "lfence" ); #else of_memory_barrier(); #endif } static OF_INLINE void of_memory_write_barrier(void) { #if !defined(OF_HAVE_THREADS) #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) __asm__ __volatile__ ( "sfence" ); #else of_memory_barrier(); #endif } |