- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.cfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
re3fea42 r09f357ec 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Feb 4 13:03:15 202013 // Update Count : 5 812 // Last Modified On : Thu Dec 5 16:25:52 2019 13 // Update Count : 52 14 14 // 15 15 … … 209 209 210 210 static void start(processor * this); 211 void ?{}(processor & this, const char name[], cluster & cltr) with( this ) {211 void ?{}(processor & this, const char * name, cluster & cltr) with( this ) { 212 212 this.name = name; 213 213 this.cltr = &cltr; … … 238 238 } 239 239 240 void ?{}(cluster & this, const char name[], Duration preemption_rate) with( this ) {240 void ?{}(cluster & this, const char * name, Duration preemption_rate) with( this ) { 241 241 this.name = name; 242 242 this.preemption_rate = preemption_rate; … … 441 441 } 442 442 443 static void Abort( int ret, const char func[]) {443 static void Abort( int ret, const char * func ) { 444 444 if ( ret ) { // pthread routines return errno values 445 445 abort( "%s : internal error, error(%d) %s.", func, ret, strerror( ret ) ); … … 469 469 ); 470 470 471 Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" ); 471 Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" ); 472 472 473 473 Abort( pthread_create( pthread, &attr, start, arg ), "pthread_create" ); … … 490 490 verify( ! kernelTLS.preemption_state.enabled ); 491 491 492 kernelTLS.this_thread->curr_cor = dst; 492 493 __stack_prepare( &dst->stack, 65000 ); 493 CtxStart( &this->runner, CtxInvokeCoroutine);494 CtxStart(main, dst, this->runner, CtxInvokeCoroutine); 494 495 495 496 verify( ! kernelTLS.preemption_state.enabled ); … … 505 506 CtxSwitch( &src->context, &dst->context ); 506 507 // when CtxSwitch returns we are back in the src coroutine 508 509 mainThread->curr_cor = &mainThread->self_cor; 507 510 508 511 // set state of new coroutine to active … … 841 844 sigemptyset( &mask ); 842 845 sigaddset( &mask, SIGALRM ); // block SIGALRM signals 843 sigaddset( &mask, SIGUSR1 ); // block SIGALRM signals 844 sigsuspend( &mask ); // block the processor to prevent further damage during abort 845 _exit( EXIT_FAILURE ); // if processor unblocks before it is killed, terminate it 846 sigsuspend( &mask ); // block the processor to prevent further damage during abort 847 _exit( EXIT_FAILURE ); // if processor unblocks before it is killed, terminate it 846 848 } 847 849 else { … … 978 980 __cfaabi_dbg_debug_do( 979 981 extern "C" { 980 void __cfaabi_dbg_record(__spinlock_t & this, const char prev_name[]) {982 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) { 981 983 this.prev_name = prev_name; 982 984 this.prev_thrd = kernelTLS.this_thread;
Note:
See TracChangeset
for help on using the changeset viewer.