Differences From Artifact [e354f89407]:
- File src/atomic.h — part of check-in [a7c16ea8b3] at 2013-01-15 02:06:57 on branch trunk — Prevent importing atomic.h without atomic ops. (user: js, size: 15310) [annotate] [blame] [check-ins using]
To 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]
︙ | ︙ | |||
652 653 654 655 656 657 658 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicXor32Barrier(i, p); #else # error No atomic operations available! #endif } | | | | | 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicXor32Barrier(i, p); #else # error No atomic operations available! #endif } static OF_INLINE bool of_atomic_cmpswap_int(volatile int *p, int o, int n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) int r; __asm__ ( "xorl %0, %0\n\t" "lock\n\t" "cmpxchg %2, %3\n\t" |
︙ | ︙ | |||
686 687 688 689 690 691 692 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwapIntBarrier(o, n, p); #else # error No atomic operations available! #endif } | | | | | 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwapIntBarrier(o, n, p); #else # error No atomic operations available! #endif } static OF_INLINE bool of_atomic_cmpswap_32(volatile int32_t *p, int32_t o, int32_t n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) int r; __asm__ ( "xorl %0, %0\n\t" "lock\n\t" "cmpxchg %2, %3\n\t" |
︙ | ︙ | |||
720 721 722 723 724 725 726 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwap32Barrier(o, n, p); #else # error No atomic operations available! #endif } | | | | | 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 | #elif defined(OF_HAVE_OSATOMIC) return OSAtomicCompareAndSwap32Barrier(o, n, p); #else # error No atomic operations available! #endif } static OF_INLINE bool of_atomic_cmpswap_ptr(void* volatile *p, void *o, void *n) { #if !defined(OF_HAVE_THREADS) if (*p == o) { *p = n; return true; } return false; #elif defined(OF_X86_ASM) || defined(OF_AMD64_ASM) int r; __asm__ ( "xorl %0, %0\n\t" "lock\n\t" "cmpxchg %2, %3\n\t" |
︙ | ︙ |