OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2010, 2012 Apple Inc. All rights reserved. |
3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) | 3 * Copyright (C) 2007 Justin Haygood (jhaygood@reaktix.com) |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #ifndef Atomics_h | 30 #ifndef Atomics_h |
31 #define Atomics_h | 31 #define Atomics_h |
32 | 32 |
33 #include "wtf/CPU.h" | 33 #include "wtf/CPU.h" |
34 #include "wtf/Platform.h" | |
35 #include <stdint.h> | 34 #include <stdint.h> |
36 | 35 |
37 #if OS(WINDOWS) | 36 #if OS(WINDOWS) |
38 #include <windows.h> | 37 #include <windows.h> |
39 #elif OS(ANDROID) | 38 #elif OS(ANDROID) |
40 #include <sys/atomics.h> | 39 #include <sys/atomics.h> |
41 #endif | 40 #endif |
42 | 41 |
43 namespace WTF { | 42 namespace WTF { |
44 | 43 |
(...skipping 20 matching lines...) Expand all Loading... |
65 ALWAYS_INLINE int64_t atomicDecrement(int64_t volatile* addend) { return __sync_
sub_and_fetch(addend, 1); } | 64 ALWAYS_INLINE int64_t atomicDecrement(int64_t volatile* addend) { return __sync_
sub_and_fetch(addend, 1); } |
66 | 65 |
67 #endif | 66 #endif |
68 | 67 |
69 } // namespace WTF | 68 } // namespace WTF |
70 | 69 |
71 using WTF::atomicDecrement; | 70 using WTF::atomicDecrement; |
72 using WTF::atomicIncrement; | 71 using WTF::atomicIncrement; |
73 | 72 |
74 #endif // Atomics_h | 73 #endif // Atomics_h |
OLD | NEW |