Changeset 58d64a4
- Timestamp:
- Sep 24, 2020, 4:22:05 PM (5 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- d8b17e2
- Parents:
- 433d352
- Location:
- libcfa/src/concurrency
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/io/setup.cfa
r433d352 r58d64a4 147 147 static void * iopoll_loop( __attribute__((unused)) void * args ) { 148 148 __processor_id_t id; 149 id.full_proc = false; 149 150 id.id = doregister(&id); 150 151 __cfaabi_dbg_print_safe( "Kernel : IO poller thread starting\n" ); -
libcfa/src/concurrency/kernel.cfa
r433d352 r58d64a4 237 237 $coroutine * proc_cor = get_coroutine(this->runner); 238 238 239 // Update global state240 kernelTLS.this_thread = thrd_dst;241 242 239 // set state of processor coroutine to inactive 243 240 verify(proc_cor->state == Active); … … 253 250 thrd_dst->unpark_stale = true; 254 251 ) 252 // Update global state 253 kernelTLS.this_thread = thrd_dst; 255 254 256 255 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); … … 259 258 /* 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 260 259 260 261 261 // set context switch to the thread that the processor is executing 262 262 verify( thrd_dst->context.SP ); … … 269 269 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 270 270 271 // Reset global state 272 kernelTLS.this_thread = 0p; 271 273 272 274 // We just finished running a thread, there are a few things that could have happened. … … 313 315 // Just before returning to the processor, set the processor coroutine to active 314 316 proc_cor->state = Active; 315 kernelTLS.this_thread = 0p;316 317 317 318 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); … … 521 522 disable_interrupts(); 522 523 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 523 bool ret =post( this->idle );524 post( this->idle ); 524 525 enable_interrupts( __cfaabi_dbg_ctx ); 525 526 } -
libcfa/src/concurrency/kernel.hfa
r433d352 r58d64a4 48 48 // Processor id, required for scheduling threads 49 49 struct __processor_id_t { 50 unsigned id; 50 unsigned id:24; 51 bool full_proc:1; 51 52 52 53 #if !defined(__CFA_NO_STATISTICS__) -
libcfa/src/concurrency/kernel/startup.cfa
r433d352 r58d64a4 471 471 this.cltr = &_cltr; 472 472 id = -1u; 473 full_proc = true; 473 474 destroyer = 0p; 474 475 do_terminate = false; -
libcfa/src/concurrency/preemption.cfa
r433d352 r58d64a4 411 411 static void * alarm_loop( __attribute__((unused)) void * args ) { 412 412 __processor_id_t id; 413 id.full_proc = false; 413 414 id.id = doregister(&id); 414 415
Note: See TracChangeset
for help on using the changeset viewer.