Ignore:
Timestamp:
Jul 7, 2021, 6:24:42 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d83b266
Parents:
1f45c7d (diff), b1a2c4a (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/ready_subqueue.hfa

    r1f45c7d rc86ee4c  
    77// Intrusives lanes which are used by the relaxed ready queue
    88struct __attribute__((aligned(128))) __intrusive_lane_t {
    9         struct $thread * prev;
     9        struct thread$ * prev;
    1010
    1111        // spin lock protecting the queue
     
    2020
    2121// Get the head pointer (one before the first element) from the anchor
    22 static inline $thread * mock_head(const __intrusive_lane_t & this) {
    23         $thread * rhead = ($thread *)(
    24                 (uintptr_t)( &this.anchor ) - __builtin_offsetof( $thread, link )
     22static inline thread$ * mock_head(const __intrusive_lane_t & this) {
     23        thread$ * rhead = (thread$ *)(
     24                (uintptr_t)( &this.anchor ) - __builtin_offsetof( thread$, link )
    2525        );
    2626        return rhead;
     
    3838
    3939        // We add a boat-load of assertions here because the anchor code is very fragile
    40         /* paranoid */ _Static_assert( offsetof( $thread, link ) == offsetof(__intrusive_lane_t, anchor) );
    41         /* paranoid */ verify( offsetof( $thread, link ) == offsetof(__intrusive_lane_t, anchor) );
    42         /* paranoid */ verify( ((uintptr_t)( mock_head(this) ) + offsetof( $thread, link )) == (uintptr_t)(&this.anchor) );
     40        /* paranoid */ _Static_assert( offsetof( thread$, link ) == offsetof(__intrusive_lane_t, anchor) );
     41        /* paranoid */ verify( offsetof( thread$, link ) == offsetof(__intrusive_lane_t, anchor) );
     42        /* paranoid */ verify( ((uintptr_t)( mock_head(this) ) + offsetof( thread$, link )) == (uintptr_t)(&this.anchor) );
    4343        /* paranoid */ verify( &mock_head(this)->link.next == &this.anchor.next );
    4444        /* paranoid */ verify( &mock_head(this)->link.ts   == &this.anchor.ts   );
     
    6161// Push a thread onto this lane
    6262// returns true of lane was empty before push, false otherwise
    63 static inline void push( __intrusive_lane_t & this, $thread * node ) {
     63static inline void push( __intrusive_lane_t & this, thread$ * node ) {
    6464        /* paranoid */ verify( this.lock );
    6565        /* paranoid */ verify( node->link.next == 0p );
     
    9191// returns popped
    9292// returns true of lane was empty before push, false otherwise
    93 static inline [* $thread, unsigned long long] pop( __intrusive_lane_t & this ) {
     93static inline [* thread$, unsigned long long] pop( __intrusive_lane_t & this ) {
    9494        /* paranoid */ verify( this.lock );
    9595        /* paranoid */ verify( this.anchor.next != 0p );
     
    9999        // Get the relevant nodes locally
    100100        unsigned long long ts = this.anchor.ts;
    101         $thread * node = this.anchor.next;
     101        thread$ * node = this.anchor.next;
    102102        this.anchor.next = node->link.next;
    103103        this.anchor.ts   = node->link.ts;
Note: See TracChangeset for help on using the changeset viewer.