Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
|
noelallen1
2013/07/19 21:56:37
C
Sam Clegg
2013/07/22 18:15:50
Done.
| |
| 3 * found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 */ | |
| 5 | 4 |
| 6 #ifndef LIBRARIES_SDK_UTIL_ATOMICOPS_H_ | 5 #ifndef LIBRARIES_SDK_UTIL_ATOMICOPS_H_ |
| 7 #define LIBRARIES_SDK_UTIL_ATOMICOPS_H_ | 6 #define LIBRARIES_SDK_UTIL_ATOMICOPS_H_ |
| 8 | 7 |
| 9 #ifndef WIN32 | 8 #ifndef WIN32 |
| 10 | 9 |
| 11 #include <stdint.h> | 10 #include <stdint.h> |
| 12 typedef int32_t Atomic32; | 11 typedef int32_t Atomic32; |
| 13 | 12 |
| 14 #ifndef __llvm__ | 13 #ifndef __llvm__ |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 do { | 90 do { |
| 92 oldval = *ptr; | 91 oldval = *ptr; |
| 93 newval = oldval ^ value; | 92 newval = oldval ^ value; |
| 94 } while (InterlockedCompareExchange(ptr,newval, oldval) != oldval); | 93 } while (InterlockedCompareExchange(ptr,newval, oldval) != oldval); |
| 95 | 94 |
| 96 return newval; | 95 return newval; |
| 97 } | 96 } |
| 98 | 97 |
| 99 #endif | 98 #endif |
| 100 | 99 |
| 101 | 100 #endif // LIBRARIES_SDK_UTIL_ATOMICOPS_H_ |
| 102 #endif /* LIBRARIES_SDK_UTIL_ATOMICOPS_H_ */ | |
| OLD | NEW |