Changeset 09d4b22 for libcfa/src/concurrency/kernel.cfa
- Timestamp:
- Dec 5, 2019, 10:57:06 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- baf608a
- Parents:
- 0030ada3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/kernel.cfa
r0030ada3 r09d4b22 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 Dec 3 21:46:54201913 // Update Count : 4912 // Last Modified On : Thu Dec 5 16:25:52 2019 13 // Update Count : 52 14 14 // 15 15 … … 135 135 NULL, // cannot use 0p 136 136 NULL, 137 { NULL,1, false, false },137 { 1, false, false }, 138 138 6u //this should be seeded better but due to a bug calling rdtsc doesn't work 139 139 }; … … 453 453 454 454 size_t stacksize; 455 455 // default stack size, normally defined by shell limit 456 456 Abort( pthread_attr_getstacksize( &attr, &stacksize ), "pthread_attr_getstacksize" ); 457 457 assert( stacksize >= PTHREAD_STACK_MIN ); 458 458 459 #ifdef __CFA_DEBUG__ 460 void * stack = memalign( __page_size, stacksize + __page_size ); 461 // pthread has no mechanism to create the guard page in user supplied stack. 462 if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) { 463 abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) ); 464 } // if 465 #else 466 void * stack = malloc( stacksize ); 467 #endif 459 void * stack; 460 __cfaabi_dbg_debug_do( 461 stack = memalign( __page_size, stacksize + __page_size ); 462 // pthread has no mechanism to create the guard page in user supplied stack. 463 if ( mprotect( stack, __page_size, PROT_NONE ) == -1 ) { 464 abort( "mprotect : internal error, mprotect failure, error(%d) %s.", errno, strerror( errno ) ); 465 } // if 466 ); 467 __cfaabi_dbg_no_debug_do( 468 stack = malloc( stacksize ); 469 ); 468 470 469 471 Abort( pthread_attr_setstack( &attr, stack, stacksize ), "pthread_attr_setstack" );
Note: See TracChangeset
for help on using the changeset viewer.