Changeset ef94ae7 for libcfa/src
- Timestamp:
- Jun 21, 2021, 3:41:22 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 5614552a
- Parents:
- 4d865ca7
- Location:
- libcfa/src/concurrency
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r4d865ca7 ref94ae7 484 484 self_mon_p = &self_mon; 485 485 link.next = 0p; 486 link.ts = 0;486 link.ts = -1llu; 487 487 preferred = -1u; 488 488 last_proc = 0p; -
libcfa/src/concurrency/ready_queue.cfa
r4d865ca7 ref94ae7 679 679 if(is_empty(sl)) { 680 680 assert( sl.anchor.next == 0p ); 681 assert( sl.anchor.ts == 0);681 assert( sl.anchor.ts == -1llu ); 682 682 assert( mock_head(sl) == sl.prev ); 683 683 } else { 684 684 assert( sl.anchor.next != 0p ); 685 assert( sl.anchor.ts != 0);685 assert( sl.anchor.ts != -1llu ); 686 686 assert( mock_head(sl) != sl.prev ); 687 687 } … … 733 733 lanes.tscs = alloc(lanes.count, lanes.tscs`realloc); 734 734 for(i; lanes.count) { 735 unsigned long long tsc = ts(lanes.data[i]); 736 lanes.tscs[i].tv = tsc != 0 ? tsc : rdtscl(); 735 unsigned long long tsc1 = ts(lanes.data[i]); 736 unsigned long long tsc2 = rdtscl() 737 lanes.tscs[i].tv = min(tsc1, tsc2); 737 738 } 738 739 #endif -
libcfa/src/concurrency/ready_subqueue.hfa
r4d865ca7 ref94ae7 32 32 this.prev = mock_head(this); 33 33 this.anchor.next = 0p; 34 this.anchor.ts = 0;34 this.anchor.ts = -1llu; 35 35 #if !defined(__CFA_NO_STATISTICS__) 36 36 this.cnt = 0; … … 44 44 /* paranoid */ verify( &mock_head(this)->link.ts == &this.anchor.ts ); 45 45 /* paranoid */ verify( mock_head(this)->link.next == 0p ); 46 /* paranoid */ verify( mock_head(this)->link.ts == 0);46 /* paranoid */ verify( mock_head(this)->link.ts == -1llu ); 47 47 /* paranoid */ verify( mock_head(this) == this.prev ); 48 48 /* paranoid */ verify( __alignof__(__intrusive_lane_t) == 128 ); … … 55 55 // Make sure the list is empty 56 56 /* paranoid */ verify( this.anchor.next == 0p ); 57 /* paranoid */ verify( this.anchor.ts == 0);57 /* paranoid */ verify( this.anchor.ts == -1llu ); 58 58 /* paranoid */ verify( mock_head(this) == this.prev ); 59 59 } … … 64 64 /* paranoid */ verify( this.lock ); 65 65 /* paranoid */ verify( node->link.next == 0p ); 66 /* paranoid */ verify( node->link.ts == 0);66 /* paranoid */ verify( node->link.ts == -1llu ); 67 67 /* paranoid */ verify( this.prev->link.next == 0p ); 68 /* paranoid */ verify( this.prev->link.ts == 0);68 /* paranoid */ verify( this.prev->link.ts == -1llu ); 69 69 if( this.anchor.next == 0p ) { 70 70 /* paranoid */ verify( this.anchor.next == 0p ); 71 /* paranoid */ verify( this.anchor.ts == 0 ); 71 /* paranoid */ verify( this.anchor.ts == -1llu ); 72 /* paranoid */ verify( this.anchor.ts != 0 ); 72 73 /* paranoid */ verify( this.prev == mock_head( this ) ); 73 74 } else { 74 75 /* paranoid */ verify( this.anchor.next != 0p ); 76 /* paranoid */ verify( this.anchor.ts != -1llu ); 75 77 /* paranoid */ verify( this.anchor.ts != 0 ); 76 78 /* paranoid */ verify( this.prev != mock_head( this ) ); … … 92 94 /* paranoid */ verify( this.lock ); 93 95 /* paranoid */ verify( this.anchor.next != 0p ); 96 /* paranoid */ verify( this.anchor.ts != -1llu ); 94 97 /* paranoid */ verify( this.anchor.ts != 0 ); 95 98 … … 99 102 this.anchor.next = node->link.next; 100 103 this.anchor.ts = node->link.ts; 101 bool is_empty = this.anchor. ts == 0;104 bool is_empty = this.anchor.next == 0p; 102 105 node->link.next = 0p; 103 node->link.ts = 0;106 node->link.ts = -1llu; 104 107 #if !defined(__CFA_NO_STATISTICS__) 105 108 this.cnt--; … … 110 113 111 114 /* paranoid */ verify( node->link.next == 0p ); 112 /* paranoid */ verify( node->link.ts == 0 ); 115 /* paranoid */ verify( node->link.ts == -1llu ); 116 /* paranoid */ verify( node->link.ts != 0 ); 117 /* paranoid */ verify( this.anchor.ts != 0 ); 113 118 return [node, ts]; 114 119 } … … 116 121 // Check whether or not list is empty 117 122 static inline bool is_empty(__intrusive_lane_t & this) { 118 return this.anchor. ts == 0;123 return this.anchor.next == 0p; 119 124 } 120 125 … … 122 127 static inline unsigned long long ts(__intrusive_lane_t & this) { 123 128 // Cannot verify here since it may not be locked 129 /* paranoid */ verify(this.anchor.ts != 0); 124 130 return this.anchor.ts; 125 131 } -
libcfa/src/concurrency/thread.cfa
r4d865ca7 ref94ae7 40 40 curr_cluster = &cl; 41 41 link.next = 0p; 42 link.ts = 0;42 link.ts = -1llu; 43 43 preferred = -1u; 44 44 last_proc = 0p;
Note: See TracChangeset
for help on using the changeset viewer.