Changes in / [7b84d3e:abb04a4]


Ignore:
Location:
libcfa/src/concurrency
Files:
2 edited

Legend:

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

    r7b84d3e rabb04a4  
    2828    unlock( lock );
    2929    park();
    30     #if defined(__ARM_ARCH)
    3130    __atomic_thread_fence( __ATOMIC_SEQ_CST );
    32     #endif
    3331    return sn.extra == 0p;
    3432}
     
    133131static inline void __cons_handoff( channel(T) & chan, T & elem ) with(chan) {
    134132    memcpy( cons`first.extra, (void *)&elem, sizeof(T) ); // do waiting consumer work
    135     #if defined(__ARM_ARCH)
    136133    __atomic_thread_fence( __ATOMIC_SEQ_CST );
    137     #endif
    138134    wake_one( cons );
    139135}
     
    142138static inline void __prods_handoff( channel(T) & chan, T & retval ) with(chan) {
    143139    memcpy( (void *)&retval, prods`first.extra, sizeof(T) );
    144     #if defined(__ARM_ARCH)
    145140    __atomic_thread_fence( __ATOMIC_SEQ_CST );
    146     #endif
    147141    wake_one( prods );
    148142}
  • libcfa/src/concurrency/locks.hfa

    r7b84d3e rabb04a4  
    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 
    189184        mcs_spin_node * prev = __atomic_exchange_n(&l.queue.tail, &n, __ATOMIC_SEQ_CST);
    190185        if( prev == 0p ) return;
    191186        prev->next = &n;
    192        
    193         #if defined(__ARM_ARCH)
    194         __asm__ __volatile__ ( "DMB ISH" ::: );
    195         #endif
    196 
    197187        while( __atomic_load_n(&n.locked, __ATOMIC_RELAXED) ) Pause();
    198 
    199         #if defined(__ARM_ARCH)
    200         __asm__ __volatile__ ( "DMB ISH" ::: );
    201         #endif
    202188}
    203189
    204190static inline void unlock(mcs_spin_lock & l, mcs_spin_node & n) {
    205         #if defined(__ARM_ARCH)
    206         __asm__ __volatile__ ( "DMB ISH" ::: );
    207         #endif
    208 
    209191        mcs_spin_node * n_ptr = &n;
    210192        if (__atomic_compare_exchange_n(&l.queue.tail, &n_ptr, 0p, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) return;
    211193        while (__atomic_load_n(&n.next, __ATOMIC_RELAXED) == 0p) Pause();
    212 
    213         #if defined(__ARM_ARCH)
    214         __asm__ __volatile__ ( "DMB ISH" ::: );
    215         #endif
    216 
    217194        n.next->locked = false;
    218195}
Note: See TracChangeset for help on using the changeset viewer.