Ignore:
Timestamp:
Oct 28, 2022, 5:30:57 PM (18 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master
Children:
f1f481a
Parents:
be5f0a5
Message:

Renamed ready-queue link fields to rdy_link

File:
1 edited

Legend:

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

    rbe5f0a5 r15c93d8  
    2525static inline thread$ * mock_head(const __intrusive_lane_t & this) {
    2626        thread$ * rhead = (thread$ *)(
    27                 (uintptr_t)( &this.l.anchor ) - __builtin_offsetof( thread$, link )
     27                (uintptr_t)( &this.l.anchor ) - __builtin_offsetof( thread$, rdy_link )
    2828        );
    2929        return rhead;
     
    3434static inline void push( __intrusive_lane_t & this, thread$ * node ) {
    3535        /* paranoid */ verify( this.l.lock );
    36         /* paranoid */ verify( node->link.next == 0p );
    37         /* paranoid */ verify( __atomic_load_n(&node->link.ts, __ATOMIC_RELAXED) == MAX  );
    38         /* paranoid */ verify( this.l.prev->link.next == 0p );
    39         /* paranoid */ verify( __atomic_load_n(&this.l.prev->link.ts, __ATOMIC_RELAXED)   == MAX  );
     36        /* paranoid */ verify( node->rdy_link.next == 0p );
     37        /* paranoid */ verify( __atomic_load_n(&node->rdy_link.ts, __ATOMIC_RELAXED) == MAX  );
     38        /* paranoid */ verify( this.l.prev->rdy_link.next == 0p );
     39        /* paranoid */ verify( __atomic_load_n(&this.l.prev->rdy_link.ts, __ATOMIC_RELAXED)   == MAX  );
    4040        if( this.l.anchor.next == 0p ) {
    4141                /* paranoid */ verify( this.l.anchor.next == 0p );
     
    5151
    5252        // Get the relevant nodes locally
    53         this.l.prev->link.next = node;
    54         __atomic_store_n(&this.l.prev->link.ts, rdtscl(), __ATOMIC_RELAXED);
     53        this.l.prev->rdy_link.next = node;
     54        __atomic_store_n(&this.l.prev->rdy_link.ts, rdtscl(), __ATOMIC_RELAXED);
    5555        this.l.prev = node;
    5656        #if !defined(__CFA_NO_STATISTICS__)
     
    7070        // Get the relevant nodes locally
    7171        thread$ * node = this.l.anchor.next;
    72         this.l.anchor.next = node->link.next;
    73         __atomic_store_n(&this.l.anchor.ts, __atomic_load_n(&node->link.ts, __ATOMIC_RELAXED), __ATOMIC_RELAXED);
     72        this.l.anchor.next = node->rdy_link.next;
     73        __atomic_store_n(&this.l.anchor.ts, __atomic_load_n(&node->rdy_link.ts, __ATOMIC_RELAXED), __ATOMIC_RELAXED);
    7474        bool is_empty = this.l.anchor.next == 0p;
    75         node->link.next = 0p;
    76         __atomic_store_n(&node->link.ts, ULLONG_MAX, __ATOMIC_RELAXED);
     75        node->rdy_link.next = 0p;
     76        __atomic_store_n(&node->rdy_link.ts, ULLONG_MAX, __ATOMIC_RELAXED);
    7777        #if !defined(__CFA_NO_STATISTICS__)
    7878                this.l.cnt--;
     
    8383
    8484        unsigned long long ats = __atomic_load_n(&this.l.anchor.ts, __ATOMIC_RELAXED);
    85         /* paranoid */ verify( node->link.next == 0p );
    86         /* paranoid */ verify( __atomic_load_n(&node->link.ts , __ATOMIC_RELAXED) == MAX );
    87         /* paranoid */ verify( __atomic_load_n(&node->link.ts , __ATOMIC_RELAXED) != 0   );
     85        /* paranoid */ verify( node->rdy_link.next == 0p );
     86        /* paranoid */ verify( __atomic_load_n(&node->rdy_link.ts , __ATOMIC_RELAXED) == MAX );
     87        /* paranoid */ verify( __atomic_load_n(&node->rdy_link.ts , __ATOMIC_RELAXED) != 0   );
    8888        /* paranoid */ verify( ats != 0 );
    8989        /* paranoid */ verify( (ats == MAX) == is_empty );
Note: See TracChangeset for help on using the changeset viewer.