Changeset 89a3df5


Ignore:
Timestamp:
Mar 15, 2017, 3:59:09 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
0e7b95c
Parents:
0ea1b65
Message:

Removed unnecessary getter for this_processor

Location:
src/libcfa/concurrency
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/coroutine.c

    r0ea1b65 r89a3df5  
    3232#include "invoke.h"
    3333
    34 extern processor * get_this_processor();
     34extern thread_local processor * this_processor;
    3535
    3636//-----------------------------------------------------------------------------
     
    109109
    110110        // set new coroutine that task is executing
    111         get_this_processor()->current_coroutine = dst;                 
     111        this_processor->current_coroutine = dst;
    112112
    113113        // context switch to specified coroutine
  • src/libcfa/concurrency/kernel.c

    r0ea1b65 r89a3df5  
    5555thread_local processor * this_processor;
    5656
    57 processor * get_this_processor() {
    58         return this_processor;
    59 }
    60 
    6157coroutine * this_coroutine(void) {
    6258        return this_processor->current_coroutine;
     
    317313
    318314void ScheduleInternal( spinlock * lock ) {
    319         get_this_processor()->finish.action_code = Release;
    320         get_this_processor()->finish.lock = lock;
     315        this_processor->finish.action_code = Release;
     316        this_processor->finish.lock = lock;
    321317        suspend();
    322318}
    323319
    324320void ScheduleInternal( thread * thrd ) {
    325         get_this_processor()->finish.action_code = Schedule;
    326         get_this_processor()->finish.thrd = thrd;
     321        this_processor->finish.action_code = Schedule;
     322        this_processor->finish.thrd = thrd;
    327323        suspend();
    328324}
    329325
    330326void ScheduleInternal( spinlock * lock, thread * thrd ) {
    331         get_this_processor()->finish.action_code = Release_Schedule;
    332         get_this_processor()->finish.lock = lock;
    333         get_this_processor()->finish.thrd = thrd;
     327        this_processor->finish.action_code = Release_Schedule;
     328        this_processor->finish.lock = lock;
     329        this_processor->finish.thrd = thrd;
    334330        suspend();
    335331}
  • src/libcfa/concurrency/thread.c

    r0ea1b65 r89a3df5  
    2828}
    2929
    30 extern processor * get_this_processor();
     30extern thread_local processor * this_processor;
    3131
    3232//-----------------------------------------------------------------------------
     
    7777        thread*  thrd_h = get_thread   (this);
    7878        thrd_c->last = this_coroutine();
    79         get_this_processor()->current_coroutine = thrd_c;
     79        this_processor->current_coroutine = thrd_c;
    8080
    8181        LIB_DEBUG_PRINTF("Thread start : %p (t %p, c %p)\n", this, thrd_c, thrd_h);
     
    9494
    9595void yield( void ) {
    96         ScheduleInternal( get_this_processor()->current_thread );
     96        ScheduleInternal( this_processor->current_thread );
    9797}
    9898
     
    107107        // set new coroutine that the processor is executing
    108108        // and context switch to it
    109         get_this_processor()->current_coroutine = dst; 
     109        this_processor->current_coroutine = dst;
    110110        CtxSwitch( src->stack.context, dst->stack.context );
    111         get_this_processor()->current_coroutine = src; 
     111        this_processor->current_coroutine = src;
    112112
    113113        // set state of new coroutine to active
Note: See TracChangeset for help on using the changeset viewer.