Changeset 41b8ea4 for libcfa/src/bits
- Timestamp:
- Oct 7, 2020, 5:10:45 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 490fb92e, 69c5c00
- Parents:
- 2fb35df (diff), 848439f (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. - Location:
- libcfa/src/bits
- Files:
-
- 2 edited
-
containers.hfa (modified) (1 diff)
-
locks.hfa (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/bits/containers.hfa
r2fb35df r41b8ea4 157 157 tail = &get_next( *val ); 158 158 *tail = 1p; 159 } 160 161 T * peek( __queue(T) & this ) { 162 verify(*this.tail == 1p); 163 T * head = this.head; 164 if( head != 1p ) { 165 verify(*this.tail == 1p); 166 return head; 167 } 168 verify(*this.tail == 1p); 169 return 0p; 159 170 } 160 171 -
libcfa/src/bits/locks.hfa
r2fb35df r41b8ea4 164 164 165 165 struct $thread; 166 extern void park( __cfaabi_dbg_ctx_param);167 extern void unpark( struct $thread * this __cfaabi_dbg_ctx_param2);166 extern void park( void ); 167 extern void unpark( struct $thread * this ); 168 168 static inline struct $thread * active_thread (); 169 169 … … 191 191 /* paranoid */ verify( expected == 0p ); 192 192 if(__atomic_compare_exchange_n(&this.ptr, &expected, active_thread(), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 193 park( __cfaabi_dbg_ctx);193 park(); 194 194 return true; 195 195 } … … 210 210 else { 211 211 if(__atomic_compare_exchange_n(&this.ptr, &expected, 0p, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 212 unpark( expected __cfaabi_dbg_ctx2);212 unpark( expected ); 213 213 return true; 214 214 } … … 244 244 /* paranoid */ verify( expected == 0p ); 245 245 if(__atomic_compare_exchange_n(&this.ptr, &expected, active_thread(), false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 246 park( __cfaabi_dbg_ctx);246 park(); 247 247 /* paranoid */ verify( this.ptr == 1p ); 248 248 return true; … … 256 256 struct $thread * got = __atomic_exchange_n( &this.ptr, 1p, __ATOMIC_SEQ_CST); 257 257 if( got == 0p ) return false; 258 unpark( got __cfaabi_dbg_ctx2);258 unpark( got ); 259 259 return true; 260 260 }
Note:
See TracChangeset
for help on using the changeset viewer.