Ignore:
Timestamp:
Nov 13, 2023, 3:43:43 AM (23 months ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
25f2798
Parents:
0030b508 (diff), 2174191 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

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

    r0030b508 rfc12f05  
    182182static inline void lock( mcs_spin_lock & l, mcs_spin_node & n ) {
    183183    n.locked = true;
     184
     185        #if defined(__ARM_ARCH)
     186        __asm__ __volatile__ ( "DMB ISH" ::: );
     187        #endif
     188
    184189        mcs_spin_node * prev = __atomic_exchange_n(&l.queue.tail, &n, __ATOMIC_SEQ_CST);
    185190        if( prev == 0p ) return;
    186191        prev->next = &n;
     192       
     193        #if defined(__ARM_ARCH)
     194        __asm__ __volatile__ ( "DMB ISH" ::: );
     195        #endif
     196
    187197        while( __atomic_load_n(&n.locked, __ATOMIC_RELAXED) ) Pause();
     198
     199        #if defined(__ARM_ARCH)
     200        __asm__ __volatile__ ( "DMB ISH" ::: );
     201        #endif
    188202}
    189203
    190204static inline void unlock(mcs_spin_lock & l, mcs_spin_node & n) {
     205        #if defined(__ARM_ARCH)
     206        __asm__ __volatile__ ( "DMB ISH" ::: );
     207        #endif
     208
    191209        mcs_spin_node * n_ptr = &n;
    192210        if (__atomic_compare_exchange_n(&l.queue.tail, &n_ptr, 0p, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) return;
    193211        while (__atomic_load_n(&n.next, __ATOMIC_RELAXED) == 0p) Pause();
     212
     213        #if defined(__ARM_ARCH)
     214        __asm__ __volatile__ ( "DMB ISH" ::: );
     215        #endif
     216
    194217        n.next->locked = false;
    195218}
Note: See TracChangeset for help on using the changeset viewer.