Changeset 181469 in webkit
- Timestamp:
- Mar 12, 2015 8:02:16 PM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r181467 r181469 1 2015-03-12 Mark Lam <mark.lam@apple.com> 2 3 Change the DFG crashLock to use std::atomic. 4 <https://webkit.org/b/142649> 5 6 Reviewed by Filip Pizlo. 7 8 * dfg/DFGCommon.cpp: 9 (JSC::DFG::startCrashing): 10 (JSC::DFG::isCrashing): 11 1 12 2015-03-12 Filip Pizlo <fpizlo@apple.com> 2 13 -
trunk/Source/JavaScriptCore/dfg/DFGCommon.cpp
r180279 r181469 35 35 namespace JSC { namespace DFG { 36 36 37 static unsignedcrashLock;37 static std::atomic<unsigned> crashLock; 38 38 39 39 void startCrashing() 40 40 { 41 #if ENABLE(COMPARE_AND_SWAP) 42 while (! WTF::weakCompareAndSwap(&crashLock, 0, 1))41 unsigned expected = 0; 42 while (!crashLock.compare_exchange_weak(expected, 1, std::memory_order_acquire)) { 43 43 std::this_thread::yield(); 44 #else 45 crashLock = 1; 46 #endif 44 expected = 0; 45 } 47 46 } 48 47 49 48 bool isCrashing() 50 49 { 51 return !!crashLock ;50 return !!crashLock.load(std::memory_order_acquire); 52 51 } 53 52
Note: See TracChangeset
for help on using the changeset viewer.