Changeset 6f8c46d for libcfa/src/concurrency
- Timestamp:
- Jun 15, 2021, 11:34:45 AM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 4f1b8f3f
- Parents:
- b6749fd (diff), 07033ce (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/concurrency
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
rb6749fd r6f8c46d 422 422 __cfactx_switch( &proc_cor->context, &thrd_dst->context ); 423 423 // when __cfactx_switch returns we are back in the processor coroutine 424 425 424 426 425 427 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd_dst->canary ); … … 522 524 523 525 /* paranoid */ verify( ! __preemption_enabled() ); 524 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ) , "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src );525 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) > ((uintptr_t)__get_stack(thrd_src->curr_cor)->limit) , "ERROR : Returning $thread %p has been corrupted.\n StackPointer too large.\n", thrd_src );526 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) < ((uintptr_t)__get_stack(thrd_src->curr_cor)->base ) || thrd_src->corctx_flag, "ERROR : Returning $thread %p has been corrupted.\n StackPointer too small.\n", thrd_src ); 527 /* paranoid */ verifyf( ((uintptr_t)thrd_src->context.SP) > ((uintptr_t)__get_stack(thrd_src->curr_cor)->limit) || thrd_src->corctx_flag, "ERROR : Returning $thread %p has been corrupted.\n StackPointer too large.\n", thrd_src ); 526 528 } 527 529 -
libcfa/src/concurrency/locks.hfa
rb6749fd r6f8c46d 21 21 #include "bits/weakso_locks.hfa" 22 22 #include "containers/queueLockFree.hfa" 23 23 #include "limits.hfa" 24 24 #include "thread.hfa" 25 25 … … 85 85 bool tryP(BinaryBenaphore & this) { 86 86 ssize_t c = this.counter; 87 /* paranoid */ verify( c > MIN ); 87 88 return (c >= 1) && __atomic_compare_exchange_n(&this.counter, &c, c-1, false, __ATOMIC_SEQ_CST, __ATOMIC_RELAXED); 88 89 } … … 92 93 ssize_t c = 0; 93 94 for () { 95 /* paranoid */ verify( this.counter < MAX ); 94 96 if (__atomic_compare_exchange_n(&this.counter, &c, c+1, false, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST)) { 95 97 if (c == 0) return true;
Note:
See TracChangeset
for help on using the changeset viewer.