Ignore:
Timestamp:
Nov 17, 2020, 4:29:51 PM (14 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
3ea8ad1
Parents:
1e208ea
Message:

Minor improvments to assertions and comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/monitor.cfa

    r1e208ea r9d6e1b8a  
    166166        }
    167167        // 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.
    168169        // to avoid that it sets the owner to the special value thrd | 1p before exiting
    169170        else if( this->owner == ($thread*)(1 | (uintptr_t)thrd) ) {
     
    172173
    173174                // No one has the monitor, just take it
    174                 this->owner = thrd;
     175                __set_owner( this, thrd );
    175176
    176177                verifyf( active_thread() == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", active_thread(), this->owner, this->recursion, this );
     
    285286
    286287        // Lock the monitor now
     288        /* paranoid */ verify( 0x0D15EA5E0D15EA5Ep == thrd->canary );
    287289        /* 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
    288295        /* 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() );
    290296        /* paranoid */ verify( thrd->state == Halted );
    291297        /* paranoid */ verify( this->recursion == 1 );
Note: See TracChangeset for help on using the changeset viewer.