⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 181545 in webkit


Ignore:
Timestamp:
Mar 16, 2015, 4:47:11 AM (11 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r181469 - Change the DFG crashLock to use std::atomic.
<https://webkit.org/b/142649>

Reviewed by Filip Pizlo.

  • dfg/DFGCommon.cpp:

(JSC::DFG::startCrashing):
(JSC::DFG::isCrashing):

Location:
releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/ChangeLog

    r181541 r181545  
     12015-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
    1122015-03-12  Mark Lam  <mark.lam@apple.com>
    213
  • releases/WebKitGTK/webkit-2.8/Source/JavaScriptCore/dfg/DFGCommon.cpp

    r171380 r181545  
    3434namespace JSC { namespace DFG {
    3535
    36 static unsigned crashLock;
     36static std::atomic<unsigned> crashLock;
    3737
    3838void startCrashing()
    3939{
    40 #if ENABLE(COMPARE_AND_SWAP)
    41     while (!WTF::weakCompareAndSwap(&crashLock, 0, 1))
     40    unsigned expected = 0;
     41    while (!crashLock.compare_exchange_weak(expected, 1, std::memory_order_acquire)) {
    4242        std::this_thread::yield();
    43 #else
    44     crashLock = 1;
    45 #endif
     43        expected = 0;
     44    }
    4645}
    4746
    4847bool isCrashing()
    4948{
    50     return !!crashLock;
     49    return !!crashLock.load(std::memory_order_acquire);
    5150}
    5251
Note: See TracChangeset for help on using the changeset viewer.