Changeset 83a071f9 for src/libcfa/concurrency/kernel.c
- Timestamp:
- Aug 11, 2017, 10:10:26 AM (7 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel.c
r8499c707 r83a071f9 139 139 } 140 140 141 void ?{}(processor & this, cluster * cltr, processorCtx_t *runner) {141 void ?{}(processor & this, cluster * cltr, processorCtx_t & runner) { 142 142 this.cltr = cltr; 143 143 (this.terminated){ 0 }; … … 148 148 this.kernel_thread = pthread_self(); 149 149 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 }; 153 153 } 154 154 155 155 LIB_DEBUG_DO( bool validate( alarm_list_t * this ); ) 156 156 157 void ?{}(system_proc_t & this, cluster * cltr, processorCtx_t *runner) {157 void ?{}(system_proc_t & this, cluster * cltr, processorCtx_t & runner) { 158 158 (this.alarms){}; 159 159 (this.alarm_lock){}; … … 187 187 //============================================================================================= 188 188 //Main of the processor contexts 189 void main(processorCtx_t *runner) {190 processor * this = runner ->proc;189 void main(processorCtx_t & runner) { 190 processor * this = runner.proc; 191 191 192 192 LIB_DEBUG_PRINT_SAFE("Kernel : core %p starting\n", this); … … 233 233 // from the processor coroutine to the target thread 234 234 void runThread(processor * this, thread_desc * dst) { 235 coroutine_desc * proc_cor = get_coroutine( this->runner);235 coroutine_desc * proc_cor = get_coroutine(*this->runner); 236 236 coroutine_desc * thrd_cor = get_coroutine(dst); 237 237 … … 315 315 // appropriate stack. 316 316 proc_cor_storage.__cor.state = Active; 317 main( &proc_cor_storage );317 main( proc_cor_storage ); 318 318 proc_cor_storage.__cor.state = Halted; 319 319 … … 455 455 mainThread = (thread_desc *)&mainThreadStorage; 456 456 current_stack_info_t info; 457 mainThread{ &info };457 (*mainThread){ &info }; 458 458 459 459 LIB_DEBUG_PRINT_SAFE("Kernel : Main thread ready\n"); … … 461 461 // Initialize the system cluster 462 462 systemCluster = (cluster *)&systemClusterStorage; 463 systemCluster{};463 (*systemCluster){}; 464 464 465 465 LIB_DEBUG_PRINT_SAFE("Kernel : System cluster ready\n"); … … 468 468 // (the coroutine that contains the processing control flow) 469 469 systemProcessor = (system_proc_t *)&systemProcessorStorage; 470 (*systemProcessor){ systemCluster, (processorCtx_t *)&systemProcessorCtxStorage };470 (*systemProcessor){ systemCluster, *(processorCtx_t *)&systemProcessorCtxStorage }; 471 471 472 472 // Add the main thread to the ready queue … … 486 486 // context. Hence, the main thread does not begin through CtxInvokeThread, like all other threads. The trick here is that 487 487 // mainThread is on the ready queue when this call is made. 488 resume( systemProcessor->proc.runner );488 resume( *systemProcessor->proc.runner ); 489 489 490 490 … … 514 514 // Destroy the system processor and its context in reverse order of construction 515 515 // These were manually constructed so we need manually destroy them 516 ^( systemProcessor->proc.runner){};516 ^(*systemProcessor->proc.runner){}; 517 517 ^(systemProcessor){}; 518 518
Note: See TracChangeset
for help on using the changeset viewer.