Changeset 118603 in webkit
- Timestamp:
- May 25, 2012, 8:09:34 PM (14 years ago)
- Location:
- trunk/Source/WTF
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
wtf/Atomics.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WTF/ChangeLog
r118344 r118603 1 2012-05-25 Filip Pizlo <fpizlo@apple.com> 2 3 weakCompareAndSwap should work on Windows 4 https://bugs.webkit.org/show_bug.cgi?id=87549 5 6 Reviewed by Jessie Berlin. 7 8 * wtf/Atomics.h: 9 (WTF): 10 (WTF::weakCompareAndSwap): 11 1 12 2012-05-24 Allan Sandfeld Jensen <allan.jensen@nokia.com> 2 13 -
trunk/Source/WTF/wtf/Atomics.h
r111778 r118603 119 119 #endif 120 120 121 #if OS(WINDOWS) 122 inline bool weakCompareAndSwap(volatile unsigned* location, unsigned expected, unsigned newValue) 123 { 124 return InterlockedCompareExchange(reinterpret_cast<LONG volatile*>(location), static_cast<LONG>(newValue), static_cast<LONG>(expected)) == static_cast<LONG>(expected); 125 } 126 127 inline bool weakCompareAndSwap(void*volatile* location, void* expected, void* newValue) 128 { 129 return InterlockedCompareExchangePointer(location, newValue, expected) == expected; 130 } 131 #else // OS(WINDOWS) --> not windows 121 132 #if COMPILER(GCC) && !COMPILER(CLANG) // Work around a gcc bug 122 133 inline bool weakCompareAndSwap(volatile unsigned* location, unsigned expected, unsigned newValue) … … 185 196 #endif // ENABLE(COMPARE_AND_SWAP) 186 197 } 198 #endif // OS(WINDOWS) (end of the not-windows case) 187 199 188 200 inline bool weakCompareAndSwapUIntPtr(volatile uintptr_t* location, uintptr_t expected, uintptr_t newValue)
Note:
See TracChangeset
for help on using the changeset viewer.