Changeset 29e1582


Ignore:
Timestamp:
Jul 5, 2026, 11:31:08 PM (4 days ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
0244ab6
Parents:
f9e61c1
Message:

fix -O2 problem with new atomic macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/concurrency/lockfree_stack.cfa

    rf9e61c1 r29e1582  
    1010// Created On       : Thu May 25 15:36:50 2023
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jun  9 14:01:07 2023
    13 // Update Count     : 68
     12// Last Modified On : Sat Jul  4 15:59:49 2026
     13// Update Count     : 74
    1414//
    1515
    1616#include <thread.hfa>
    17 #include <atomic.hfa>                                                                   // CASV
     17#include <bits/atomic.hfa>                                                              // AtomicCasv
    1818#include <fstream.hfa>
    1919
     
    4343        for () {                                                                                        // busy wait
    4444                Link temp{ { &n, n.next.count + 1 } };
    45                 if ( CASV( s.stack.atom, n.next.atom, temp.atom ) ) break; // attempt to update top node
     45                if ( AtomicCasv( s.stack.atom, n.next.atom, temp.atom ) ) break; // attempt to update top node
    4646        }
    4747}
     
    5252                if ( t.top == NULL ) return NULL;                               // empty stack ?
    5353                Link temp{ { t.top->next.top, t.count } };
    54                 if ( CASV( stack.atom, t.atom, temp.atom ) ) return t.top; // attempt to update top node
     54                if ( AtomicCasv( stack.atom, t.atom, temp.atom ) ) return t.top; // attempt to update top node
    5555        }
    5656}
Note: See TracChangeset for help on using the changeset viewer.