Ignore:
Timestamp:
Aug 11, 2017, 10:10:26 AM (7 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
fd344aa
Parents:
8499c707
Message:

Fix concurrency library, tests, and keywords for references

File:
1 edited

Legend:

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

    r8499c707 r83a071f9  
    139139}
    140140
    141 void ?{}(processor & this, cluster * cltr, processorCtx_t * runner) {
     141void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) {
    142142        this.cltr = cltr;
    143143        (this.terminated){ 0 };
     
    148148        this.kernel_thread = pthread_self();
    149149
    150         this.runner = runner;
    151         LIB_DEBUG_PRINT_SAFE("Kernel : constructing system processor context %p\n", runner);
    152         (*runner){ &this };
     150        this.runner = &runner;
     151        LIB_DEBUG_PRINT_SAFE("Kernel : constructing system processor context %p\n", &runner);
     152        runner{ &this };
    153153}
    154154
    155155LIB_DEBUG_DO( bool validate( alarm_list_t * this ); )
    156156
    157 void ?{}(system_proc_t & this, cluster * cltr, processorCtx_t * runner) {
     157void ?{}(system_proc_t & this, cluster * cltr, processorCtx_t & runner) {
    158158        (this.alarms){};
    159159        (this.alarm_lock){};
     
    187187//=============================================================================================
    188188//Main of the processor contexts
    189 void main(processorCtx_t * runner) {
    190         processor * this = runner->proc;
     189void main(processorCtx_t & runner) {
     190        processor * this = runner.proc;
    191191
    192192        LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this);
     
    233233// from the processor coroutine to the target thread
    234234void runThread(processor * this, thread_desc * dst) {
    235         coroutine_desc * proc_cor = get_coroutine(this->runner);
     235        coroutine_desc * proc_cor = get_coroutine(*this->runner);
    236236        coroutine_desc * thrd_cor = get_coroutine(dst);
    237237
     
    315315        // appropriate stack.
    316316        proc_cor_storage.__cor.state = Active;
    317         main( &proc_cor_storage );
     317        main( proc_cor_storage );
    318318        proc_cor_storage.__cor.state = Halted;
    319319
     
    455455        mainThread = (thread_desc *)&mainThreadStorage;
    456456        current_stack_info_t info;
    457         mainThread{ &info };
     457        (*mainThread){ &info };
    458458
    459459        LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n");
     
    461461        // Initialize the system cluster
    462462        systemCluster = (cluster *)&systemClusterStorage;
    463         systemCluster{};
     463        (*systemCluster){};
    464464
    465465        LIB_DEBUG_PRINT_SAFE("Kernel : System cluster ready\n");
     
    468468        // (the coroutine that contains the processing control flow)
    469469        systemProcessor = (system_proc_t *)&systemProcessorStorage;
    470         (*systemProcessor){ systemCluster, (processorCtx_t *)&systemProcessorCtxStorage };
     470        (*systemProcessor){ systemCluster, *(processorCtx_t *)&systemProcessorCtxStorage };
    471471
    472472        // Add the main thread to the ready queue
     
    486486        // context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that
    487487        // mainThread is on the ready queue when this call is made.
    488         resume( systemProcessor->proc.runner );
     488        resume( *systemProcessor->proc.runner );
    489489
    490490
     
    514514        // Destroy the system processor and its context in reverse order of construction
    515515        // These were manually constructed so we need manually destroy them
    516         ^(systemProcessor->proc.runner){};
     516        ^(*systemProcessor->proc.runner){};
    517517        ^(systemProcessor){};
    518518
Note: See TracChangeset for help on using the changeset viewer.