Changeset fd365da


Ignore:
Timestamp:
Jun 27, 2022, 1:51:00 PM (2 years ago)
Author:
caparsons <caparson@…>
Branches:
ADT, ast-experimental, master, pthread-emulation, qualifiedEnum
Children:
b01d459
Parents:
d28524a
Message:

added atomics to other spin_queue style locks

File:
1 edited

Legend:

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

    rd28524a rfd365da  
    533533        #endif
    534534        lock( lock, node );
    535         while(held) Pause();
    536         held = true;
     535        while(__atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause();
     536        __atomic_store_n(&held, true, __ATOMIC_SEQ_CST);
    537537        unlock( lock, node );
    538538        #ifdef __CFA_DEBUG__
     
    545545        owner = 0p;
    546546        #endif
    547         held = false;
     547        __atomic_store_n(&held, false, __ATOMIC_SEQ_CST);
    548548}
    549549
     
    586586        #endif
    587587        lock( lock );
    588         while(held) Pause();
    589         held = true;
     588        while(__atomic_load_n(&held, __ATOMIC_SEQ_CST)) Pause();
     589        __atomic_store_n(&held, true, __ATOMIC_RELEASE);
    590590        unlock( lock );
    591591        #ifdef __CFA_DEBUG__
     
    598598        owner = 0p;
    599599        #endif
    600         held = false;
     600        __atomic_store_n(&held, false, __ATOMIC_RELEASE);
    601601}
    602602
Note: See TracChangeset for help on using the changeset viewer.