Changeset 4233338b for libcfa/src/concurrency/kernel
- Timestamp:
- Jan 10, 2022, 4:07:04 PM (4 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
- Children:
- 56d711f
- Parents:
- 0ac728b (diff), 7d0ebd0 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel/startup.cfa
r0ac728b r4233338b 279 279 // When its coroutine terminates, it return control to the mainThread 280 280 // which is currently here 281 /* paranoid */ verify( !__atomic_load_n(&mainProcessor->do_terminate, __ATOMIC_ACQUIRE) ); 281 282 __atomic_store_n(&mainProcessor->do_terminate, true, __ATOMIC_RELEASE); 283 __wake_proc( mainProcessor ); 282 284 __kernel_last_resume( __cfaabi_tls.this_processor ); 283 285 mainThread->self_cor.state = Halted; … … 403 405 404 406 __cfaabi_tls.this_thread->curr_cor = dst; 405 __stack_prepare( &dst->stack, 65000);407 __stack_prepare( &dst->stack, DEFAULT_STACK_SIZE ); 406 408 __cfactx_start(main, dst, this->runner, __cfactx_invoke_coroutine); 407 409 … … 564 566 extern size_t __page_size; 565 567 void ^?{}(processor & this) with( this ){ 566 if( ! __atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) ) { 567 __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this); 568 569 __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED); 568 /* paranoid */ verify( !__atomic_load_n(&do_terminate, __ATOMIC_ACQUIRE) ); 569 __cfadbg_print_safe(runtime_core, "Kernel : core %p signaling termination\n", &this); 570 571 __atomic_store_n(&do_terminate, true, __ATOMIC_RELAXED); 572 __disable_interrupts_checked(); 570 573 __wake_proc( &this ); 571 572 wait( terminated ); 573 /* paranoid */ verify( active_processor() != &this);574 }574 __enable_interrupts_checked(); 575 576 wait( terminated ); 577 /* paranoid */ verify( active_processor() != &this); 575 578 576 579 __destroy_pthread( kernel_thread, this.stack, 0p ); … … 721 724 check( pthread_attr_init( &attr ), "pthread_attr_init" ); // initialize attribute 722 725 723 size_t stacksize; 724 // default stack size, normally defined by shell limit 725 check( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" ); 726 assert( stacksize >= PTHREAD_STACK_MIN ); 726 size_t stacksize = DEFAULT_STACK_SIZE; 727 727 728 728 void * stack; … … 749 749 #endif 750 750 751 752 751 check( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" ); 753 754 752 check( pthread_create( pthread, &attr, start, arg ), "pthread_create" ); 755 753 return stack;
Note:
See TracChangeset
for help on using the changeset viewer.