Ignore:
Timestamp:
Mar 4, 2021, 7:40:25 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
77d601f
Parents:
342af53 (diff), a5040fe (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/containers/stackLockFree.hfa

    r342af53 r8e4aa05  
    99// Created On       : Wed May 13 20:58:58 2020
    1010// Last Modified By : Peter A. Buhr
    11 // Last Modified On : Sun Jun 14 13:25:09 2020
    12 // Update Count     : 64
     11// Last Modified On : Wed Jan 20 20:40:03 2021
     12// Update Count     : 67
    1313//
    1414
     
    1717#include <stdint.h>
    1818
    19 forall( dtype T )
     19forall( T & )
    2020union Link {
    2121        struct {                                                                                        // 32/64-bit x 2
     
    3131}; // Link
    3232
    33 forall( otype T | sized(T) | { Link(T) * ?`next( T * ); } ) {
     33forall( T | sized(T) | { Link(T) * ?`next( T * ); } ) {
    3434        struct StackLF {
    3535                Link(T) stack;
     
    4242
    4343                void push( StackLF(T) & this, T & n ) with(this) {
    44                         *( &n )`next = stack;                                   // atomic assignment unnecessary, or use CAA
     44                        *( &n )`next = stack;                                           // atomic assignment unnecessary, or use CAA
    4545                        for () {                                                                        // busy wait
    4646                          if ( __atomic_compare_exchange_n( &stack.atom, &( &n )`next->atom, (Link(T))@{ {&n, ( &n )`next->count + 1} }.atom, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST ) ) break; // attempt to update top node
     
    6565                                }
    6666                                if( next == 0p ) return false;
    67                                 link = (next)`next;
     67                                link = ( next )`next;
    6868                        }
    6969                }
Note: See TracChangeset for help on using the changeset viewer.