Ignore:
Timestamp:
Feb 14, 2020, 3:28:17 PM (4 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
8c50aed
Parents:
50b8885
Message:

Yield now uses force_yield instead of park/unpark.
Final ctxswitch of a thread now uses ad-hoc mechanism instead of park/unpark.

File:
1 edited

Legend:

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

    r50b8885 rb0c7419  
    277277                disable_interrupts();
    278278
    279                 thrd->self_cor.state = Halted;
     279                thrd->state = Halted;
    280280
    281281                /* paranoid */ verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", thrd, this->owner, this->recursion, this );
     
    296296                // Unpark the next owner if needed
    297297                /* paranoid */ verifyf( !new_owner || new_owner == this->owner, "Expected owner to be %p, got %p (m: %p)", new_owner, this->owner, this );
    298                 unpark( new_owner );
    299 
    300                 // Leave the thread, this will unlock the spinlock
    301                 // Use leave thread instead of park which is
    302                 // specialized for this case
    303                 LeaveThread();
     298                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     299                /* paranoid */ verify( ! kernelTLS.this_processor->destroyer );
     300                /* paranoid */ verify( thrd->state == Halted );
     301
     302                kernelTLS.this_processor->destroyer = new_owner;
     303
     304                // Leave the thread
     305                __leave_thread();
    304306
    305307                // Control flow should never reach here!
Note: See TracChangeset for help on using the changeset viewer.