Changeset df932552


Ignore:
Timestamp:
Jun 20, 2022, 2:03:46 PM (2 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
2ed32fa7
Parents:
76a798d
Message:

added atomic store/load for spinqueue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/locks.hfa

    r76a798d rdf932552  
    478478        #endif
    479479        lock( lock, node );
    480         while(held) Pause();
    481         held = true;
     480        while(__atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause();
     481        __atomic_store_n(&held, true, __ATOMIC_SEQ_CST);
    482482        // printf("locked\n");
    483483        unlock( lock, node );
     
    492492        owner = 0p;
    493493        #endif
    494         held = false;
     494        __atomic_store_n(&held, false, __ATOMIC_SEQ_CST);
    495495}
    496496
Note: See TracChangeset for help on using the changeset viewer.