Ignore:
Timestamp:
Sep 24, 2020, 4:22:05 PM (2 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
arm-eh, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
d8b17e2
Parents:
433d352
Message:

processor_id_t now have a bool to state if it is a full processor.
kernelTLS.this_thread now has much tighter lifetime.
Remove warning in kernel.cfa

File:
1 edited

Legend:

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

    r433d352 r58d64a4  
    237237        $coroutine * proc_cor = get_coroutine(this->runner);
    238238
    239         // Update global state
    240         kernelTLS.this_thread = thrd_dst;
    241 
    242239        // set state of processor coroutine to inactive
    243240        verify(proc_cor->state == Active);
     
    253250                        thrd_dst->unpark_stale = true;
    254251                )
     252                // Update global state
     253                kernelTLS.this_thread = thrd_dst;
    255254
    256255                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     
    259258                /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) > ((uintptr_t)__get_stack(thrd_dst->curr_cor)->limit) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too large.\n", thrd_dst ); // add escape condition if we are setting up the processor
    260259
     260
    261261                // set context switch to the thread that the processor is executing
    262262                verify( thrd_dst->context.SP );
     
    269269                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    270270
     271                // Reset global state
     272                kernelTLS.this_thread = 0p;
    271273
    272274                // We just finished running a thread, there are a few things that could have happened.
     
    313315        // Just before returning to the processor, set the processor coroutine to active
    314316        proc_cor->state = Active;
    315         kernelTLS.this_thread = 0p;
    316317
    317318        /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
     
    521522        disable_interrupts();
    522523                /* paranoid */ verify( ! kernelTLS.preemption_state.enabled );
    523                 bool ret = post( this->idle );
     524                post( this->idle );
    524525        enable_interrupts( __cfaabi_dbg_ctx );
    525526}
Note: See TracChangeset for help on using the changeset viewer.