OLD | NEW |
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
2 /* This Source Code Form is subject to the terms of the Mozilla Public | 2 /* This Source Code Form is subject to the terms of the Mozilla Public |
3 * License, v. 2.0. If a copy of the MPL was not distributed with this | 3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
5 | 5 |
6 /* GLOBAL FUNCTIONS: | 6 /* GLOBAL FUNCTIONS: |
7 ** DESCRIPTION: | 7 ** DESCRIPTION: |
8 ** PR Atomic operations | 8 ** PR Atomic operations |
9 */ | 9 */ |
10 | 10 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 #elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \ | 100 #elif ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && \ |
101 ((defined(__APPLE__) && \ | 101 ((defined(__APPLE__) && \ |
102 (defined(__ppc__) || defined(__i386__) || defined(__x86_64__))) || \ | 102 (defined(__ppc__) || defined(__i386__) || defined(__x86_64__))) || \ |
103 (defined(__linux__) && \ | 103 (defined(__linux__) && \ |
104 ((defined(__i386__) && \ | 104 ((defined(__i386__) && \ |
105 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ | 105 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ |
106 defined(__ia64__) || defined(__x86_64__) || \ | 106 defined(__ia64__) || defined(__x86_64__) || \ |
107 defined(__powerpc__) || \ | 107 defined(__powerpc__) || \ |
108 (defined(__arm__) && \ | 108 (defined(__arm__) && \ |
109 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ | 109 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)) || \ |
110 defined(__aarch64__) || defined(__alpha)))) | 110 defined(__aarch64__) || defined(__alpha) || \ |
| 111 (defined(__mips__) && \ |
| 112 defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4))))) |
111 | 113 |
112 /* | 114 /* |
113 * Because the GCC manual warns that some processors may support | 115 * Because the GCC manual warns that some processors may support |
114 * reduced functionality of __sync_lock_test_and_set, we test for the | 116 * reduced functionality of __sync_lock_test_and_set, we test for the |
115 * processors that we believe support a full atomic exchange operation. | 117 * processors that we believe support a full atomic exchange operation. |
116 */ | 118 */ |
117 | 119 |
118 #define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1) | 120 #define PR_ATOMIC_INCREMENT(val) __sync_add_and_fetch(val, 1) |
119 #define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1) | 121 #define PR_ATOMIC_DECREMENT(val) __sync_sub_and_fetch(val, 1) |
120 #define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval) | 122 #define PR_ATOMIC_SET(val, newval) __sync_lock_test_and_set(val, newval) |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 ** PR_SUCCESS - if successfully deleted | 189 ** PR_SUCCESS - if successfully deleted |
188 ** PR_FAILURE - if the stack is not empty | 190 ** PR_FAILURE - if the stack is not empty |
189 ** PR_GetError will return | 191 ** PR_GetError will return |
190 ** PR_INVALID_STATE_ERROR - stack i
s not empty | 192 ** PR_INVALID_STATE_ERROR - stack i
s not empty |
191 */ | 193 */ |
192 NSPR_API(PRStatus) PR_DestroyStack(PRStack *stack); | 194 NSPR_API(PRStatus) PR_DestroyStack(PRStack *stack); |
193 | 195 |
194 PR_END_EXTERN_C | 196 PR_END_EXTERN_C |
195 | 197 |
196 #endif /* pratom_h___ */ | 198 #endif /* pratom_h___ */ |
OLD | NEW |