Changeset 9d6e1b8a for libcfa/src/concurrency/monitor.cfa
- Timestamp:
- Nov 17, 2020, 4:29:51 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:
- 3ea8ad1
- Parents:
- 1e208ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/monitor.cfa
r1e208ea r9d6e1b8a 166 166 } 167 167 // SKULLDUGGERY: join will act as a dtor so it would normally trigger to above check 168 // because join will not release the monitor after it executed. 168 169 // to avoid that it sets the owner to the special value thrd | 1p before exiting 169 170 else if( this->owner == ($thread*)(1 | (uintptr_t)thrd) ) { … … 172 173 173 174 // No one has the monitor, just take it 174 this->owner = thrd;175 __set_owner( this, thrd ); 175 176 176 177 verifyf( active_thread() == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", active_thread(), this->owner, this->recursion, this ); … … 285 286 286 287 // Lock the monitor now 288 /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary ); 287 289 /* paranoid */ verify( this->lock.lock ); 290 /* paranoid */ verify( thrd->context.SP ); 291 /* paranoid */ verifyf( ((uintptr_t)thrd->context.SP) > ((uintptr_t)__get_stack(thrd->curr_cor)->limit), "ERROR : $thread %p has been corrupted.\n StackPointer too large.\n", thrd ); 292 /* paranoid */ verifyf( ((uintptr_t)thrd->context.SP) < ((uintptr_t)__get_stack(thrd->curr_cor)->base ), "ERROR : $thread %p has been corrupted.\n StackPointer too small.\n", thrd ); 293 /* paranoid */ verify( ! __preemption_enabled() ); 294 288 295 /* paranoid */ verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", thrd, this->owner, this->recursion, this ); 289 /* paranoid */ verify( ! __preemption_enabled() );290 296 /* paranoid */ verify( thrd->state == Halted ); 291 297 /* paranoid */ verify( this->recursion == 1 );
Note: See TracChangeset
for help on using the changeset viewer.