Ignore:
Timestamp:
May 3, 2021, 3:41:12 PM (3 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:
f6fdfb14
Parents:
bac0ba8 (diff), 2b96031 (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_queue.cfa

    rbac0ba8 rf04a3df6  
    257257
    258258                // write timestamp
    259                 thrd->link.ts = rdtscl();
     259                #if !defined(USE_NEW_SUBQUEUE)
     260                        thrd->link.ts = rdtscl();
     261                #endif
    260262
    261263                bool local;
     
    354356
    355357                // write timestamp
    356                 thrd->link.ts = rdtscl();
     358                #if !defined(USE_NEW_SUBQUEUE)
     359                        thrd->link.ts = rdtscl();
     360                #endif
    357361
    358362                // Try to pick a lane and lock it
     
    525529                                assert(!lanes.data[idx].lock);
    526530
    527                                 assert(head(sl)->link.prev == 0p );
    528                                 assert(head(sl)->link.next->link.prev == head(sl) );
    529                                 assert(tail(sl)->link.next == 0p );
    530                                 assert(tail(sl)->link.prev->link.next == tail(sl) );
    531 
    532                                 if(is_empty(sl)) {
    533                                         assert(tail(sl)->link.prev == head(sl));
    534                                         assert(head(sl)->link.next == tail(sl));
    535                                 } else {
    536                                         assert(tail(sl)->link.prev != head(sl));
    537                                         assert(head(sl)->link.next != tail(sl));
    538                                 }
     531                                #if defined(USE_NEW_SUBQUEUE)
     532                                        if(is_empty(sl)) {
     533                                                assert( sl.anchor.next == 0p );
     534                                                assert( sl.anchor.ts   == 0  );
     535                                                assert( mock_head(sl)  == sl.prev );
     536                                        } else {
     537                                                assert( sl.anchor.next != 0p );
     538                                                assert( sl.anchor.ts   != 0  );
     539                                                assert( mock_head(sl)  != sl.prev );
     540                                        }
     541                                #else
     542                                        assert(head(sl)->link.prev == 0p );
     543                                        assert(head(sl)->link.next->link.prev == head(sl) );
     544                                        assert(tail(sl)->link.next == 0p );
     545                                        assert(tail(sl)->link.prev->link.next == tail(sl) );
     546
     547                                        if(is_empty(sl)) {
     548                                                assert(tail(sl)->link.prev == head(sl));
     549                                                assert(head(sl)->link.next == tail(sl));
     550                                        } else {
     551                                                assert(tail(sl)->link.prev != head(sl));
     552                                                assert(head(sl)->link.next != tail(sl));
     553                                        }
     554                                #endif
    539555                        }
    540556                }
     
    558574static inline void fix(__intrusive_lane_t & ll) {
    559575        #if !defined(USE_MPSC)
    560                 // if the list is not empty then follow he pointer and fix its reverse
    561                 if(!is_empty(ll)) {
    562                         head(ll)->link.next->link.prev = head(ll);
    563                         tail(ll)->link.prev->link.next = tail(ll);
    564                 }
    565                 // Otherwise just reset the list
    566                 else {
    567                         verify(tail(ll)->link.next == 0p);
    568                         tail(ll)->link.prev = head(ll);
    569                         head(ll)->link.next = tail(ll);
    570                         verify(head(ll)->link.prev == 0p);
    571                 }
     576                #if defined(USE_NEW_SUBQUEUE)
     577                        if(is_empty(ll)) {
     578                                verify(ll.anchor.next == 0p);
     579                                ll.prev = mock_head(ll);
     580                        }
     581                #else
     582                        // if the list is not empty then follow he pointer and fix its reverse
     583                        if(!is_empty(ll)) {
     584                                head(ll)->link.next->link.prev = head(ll);
     585                                tail(ll)->link.prev->link.next = tail(ll);
     586                        }
     587                        // Otherwise just reset the list
     588                        else {
     589                                verify(tail(ll)->link.next == 0p);
     590                                tail(ll)->link.prev = head(ll);
     591                                head(ll)->link.next = tail(ll);
     592                                verify(head(ll)->link.prev == 0p);
     593                        }
     594                #endif
    572595        #endif
    573596}
Note: See TracChangeset for help on using the changeset viewer.