Changes in / [8da7421f:d5631b3]
- Files:
-
- 6 edited
-
Jenkinsfile (modified) (4 diffs)
-
libcfa/src/concurrency/kernel.cfa (modified) (3 diffs)
-
libcfa/src/concurrency/kernel.hfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel/startup.cfa (modified) (1 diff)
-
libcfa/src/concurrency/kernel_private.hfa (modified) (1 diff)
-
libcfa/src/concurrency/monitor.cfa (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
Jenkinsfile
r8da7421f rd5631b3 127 127 } 128 128 129 ast = Settings.NewAST ? "--enable-new-ast" : "--disable-new-ast" 130 131 sh "${SrcDir}/configure CXX=${Settings.Compiler.CXX} CC=${Settings.Compiler.CC} ${Settings.Architecture.flags} AR=gcc-ar RANLIB=gcc-ranlib ${targets} ${ast} --quiet --prefix=${BuildDir}" 129 sh "${SrcDir}/configure CXX=${Settings.Compiler.CXX} CC=${Settings.Compiler.CC} ${Settings.Architecture.flags} AR=gcc-ar RANLIB=gcc-ranlib ${targets} --quiet --prefix=${BuildDir}" 132 130 133 131 // Configure libcfa … … 361 359 public final CC_Desc Compiler 362 360 public final Arch_Desc Architecture 363 public final Boolean NewAST364 361 public final Boolean RunAllTests 365 362 public final Boolean RunBenchmark … … 413 410 414 411 this.IsSandbox = (branch == "jenkins-sandbox") 415 this.NewAST = param.NewAST416 412 this.RunAllTests = param.RunAllTests 417 413 this.RunBenchmark = param.RunBenchmark … … 474 470 ], \ 475 471 [$class: 'BooleanParameterDefinition', \ 476 description: 'If true, build compiler using new AST', \477 name: 'NewAST', \478 defaultValue: false, \479 ], \480 [$class: 'BooleanParameterDefinition', \481 472 description: 'If false, only the quick test suite is ran', \ 482 473 name: 'RunAllTests', \ 483 474 defaultValue: false, \ 484 ], 475 ], \ 485 476 [$class: 'BooleanParameterDefinition', \ 486 477 description: 'If true, jenkins also runs benchmarks', \ -
libcfa/src/concurrency/kernel.cfa
r8da7421f rd5631b3 252 252 /* paranoid */ verify( kernelTLS.this_thread == thrd_dst ); 253 253 /* paranoid */ verify( thrd_dst->context.SP ); 254 /* paranoid */ verify( thrd_dst->state != Halted );255 254 /* paranoid */ verifyf( ((uintptr_t)thrd_dst->context.SP) < ((uintptr_t)__get_stack(thrd_dst->curr_cor)->base ) || thrd_dst->curr_cor == proc_cor, "ERROR : Destination $thread %p has been corrupted.\n StackPointer too small.\n", thrd_dst ); // add escape condition if we are setting up the processor 256 255 /* 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 … … 288 287 if(unlikely(thrd_dst->state == Halted)) { 289 288 // The thread has halted, it should never be scheduled/run again 290 // finish the thread 291 __thread_finish( thrd_dst ); 289 // We may need to wake someone up here since 290 unpark( this->destroyer ); 291 this->destroyer = 0p; 292 292 break RUNNING; 293 293 } … … 448 448 } 449 449 450 extern "C" { 451 // Leave the thread monitor 452 // last routine called by a thread. 453 // Should never return 454 void __cfactx_thrd_leave() { 455 $thread * thrd = TL_GET( this_thread ); 456 $monitor * this = &thrd->self_mon; 457 458 // Lock the monitor now 459 lock( this->lock __cfaabi_dbg_ctx2 ); 460 461 disable_interrupts(); 462 463 thrd->state = Halted; 464 465 if( thrd != this->owner || this->recursion != 1) { abort( "Thread internal monitor has unbalanced recursion" ); } 466 467 // Leave the thread 468 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 469 returnToKernel(); 470 abort(); 471 472 // Control flow should never reach here! 473 } 450 // KERNEL ONLY 451 void __leave_thread() { 452 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 453 returnToKernel(); 454 abort(); 474 455 } 475 456 -
libcfa/src/concurrency/kernel.hfa
r8da7421f rd5631b3 79 79 // Handle to pthreads 80 80 pthread_t kernel_thread; 81 82 // RunThread data 83 // Action to do after a thread is ran 84 $thread * destroyer; 81 85 82 86 // Preemption data -
libcfa/src/concurrency/kernel/startup.cfa
r8da7421f rd5631b3 474 474 this.cltr = &_cltr; 475 475 full_proc = true; 476 destroyer = 0p; 476 477 do_terminate = false; 477 478 preemption_alarm = 0p; -
libcfa/src/concurrency/kernel_private.hfa
r8da7421f rd5631b3 39 39 ; 40 40 41 // release/wake-up the following resources42 void __ thread_finish( $thread * thrd);41 //Block current thread and release/wake-up the following resources 42 void __leave_thread() __attribute__((noreturn)); 43 43 44 44 //----------------------------------------------------------------------------- -
libcfa/src/concurrency/monitor.cfa
r8da7421f rd5631b3 281 281 } 282 282 283 void __thread_finish( $thread * thrd ) { 284 $monitor * this = &thrd->self_mon; 285 286 // Lock the monitor now 287 /* paranoid */ verify( this->lock.lock ); 288 /* paranoid */ verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", thrd, this->owner, this->recursion, this ); 289 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 290 /* paranoid */ verify( thrd->state == Halted ); 291 /* paranoid */ verify( this->recursion == 1 ); 292 293 // Leaving a recursion level, decrement the counter 294 this->recursion -= 1; 295 this->owner = 0p; 296 297 // Fetch the next thread, can be null 298 $thread * new_owner = next_thread( this ); 299 300 // Release the monitor lock 301 unlock( this->lock ); 302 303 // Unpark the next owner if needed 304 /* paranoid */ verifyf( !new_owner || new_owner == this->owner, "Expected owner to be %p, got %p (m: %p)", new_owner, this->owner, this ); 305 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 306 /* paranoid */ verify( thrd->state == Halted ); 307 unpark( new_owner ); 283 extern "C" { 284 // Leave the thread monitor 285 // last routine called by a thread. 286 // Should never return 287 void __cfactx_thrd_leave() { 288 $thread * thrd = TL_GET( this_thread ); 289 $monitor * this = &thrd->self_mon; 290 291 // Lock the monitor now 292 lock( this->lock __cfaabi_dbg_ctx2 ); 293 294 disable_interrupts(); 295 296 thrd->state = Halted; 297 298 /* paranoid */ verifyf( thrd == this->owner, "Expected owner to be %p, got %p (r: %i, m: %p)", thrd, this->owner, this->recursion, this ); 299 300 // Leaving a recursion level, decrement the counter 301 this->recursion -= 1; 302 303 // If we haven't left the last level of recursion 304 // it must mean there is an error 305 if( this->recursion != 0) { abort( "Thread internal monitor has unbalanced recursion" ); } 306 307 // Fetch the next thread, can be null 308 $thread * new_owner = next_thread( this ); 309 310 // Release the monitor lock 311 unlock( this->lock ); 312 313 // Unpark the next owner if needed 314 /* paranoid */ verifyf( !new_owner || new_owner == this->owner, "Expected owner to be %p, got %p (m: %p)", new_owner, this->owner, this ); 315 /* paranoid */ verify( ! kernelTLS.preemption_state.enabled ); 316 /* paranoid */ verify( ! kernelTLS.this_processor->destroyer ); 317 /* paranoid */ verify( thrd->state == Halted ); 318 319 kernelTLS.this_processor->destroyer = new_owner; 320 321 // Leave the thread 322 __leave_thread(); 323 324 // Control flow should never reach here! 325 } 308 326 } 309 327
Note:
See TracChangeset
for help on using the changeset viewer.