- File:
-
- 1 edited
-
libcfa/src/concurrency/kernel.cfa (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r09f357ec re3fea42 10 10 // Created On : Tue Jan 17 12:27:26 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T hu Dec 5 16:25:52 201913 // Update Count : 5 212 // Last Modified On : Tue Feb 4 13:03:15 2020 13 // Update Count : 58 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;493 492 __stack_prepare( &dst->stack, 65000 ); 494 CtxStart( main, dst,this->runner, CtxInvokeCoroutine);493 CtxStart(&this->runner, CtxInvokeCoroutine); 495 494 496 495 verify( ! kernelTLS.preemption_state.enabled ); … … 506 505 CtxSwitch( &src->context, &dst->context ); 507 506 // when CtxSwitch returns we are back in the src coroutine 508 509 mainThread->curr_cor = &mainThread->self_cor;510 507 511 508 // set state of new coroutine to active … … 844 841 sigemptyset( &mask ); 845 842 sigaddset( &mask, SIGALRM ); // block SIGALRM signals 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 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 848 846 } 849 847 else { … … 980 978 __cfaabi_dbg_debug_do( 981 979 extern "C" { 982 void __cfaabi_dbg_record(__spinlock_t & this, const char * prev_name) {980 void __cfaabi_dbg_record(__spinlock_t & this, const char prev_name[]) { 983 981 this.prev_name = prev_name; 984 982 this.prev_thrd = kernelTLS.this_thread;
Note:
See TracChangeset
for help on using the changeset viewer.