- File:
-
- 1 edited
-
libcfa/src/concurrency/preemption.cfa (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
libcfa/src/concurrency/preemption.cfa
r27f5f71 r1805b1b 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : S at Nov 30 08:02:56 201913 // Update Count : 3912 // Last Modified On : Sun Dec 1 22:22:56 2019 13 // Update Count : 41 14 14 // 15 15 … … 306 306 signal_block( SIGALRM ); 307 307 308 pthread_attr_t attr; 309 int ret; 310 ret = pthread_attr_init( &attr ); // initialize attribute 311 if ( ret ) { 312 abort( "%s : internal error, pthread_attr_init failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) ); 313 } // if 314 315 size_t stacksize; 316 ret = pthread_attr_getstacksize( &attr, &stacksize ); // default stack size, normally defined by shell limit 317 if ( ret ) { 318 abort( "%s : internal error, pthread_attr_getstacksize failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) ); 319 } // if 320 assert( stacksize >= PTHREAD_STACK_MIN ); 321 322 kernelTLS.preemption_state.stack = malloc( stacksize ); 323 ret = pthread_attr_setstack( &attr, kernelTLS.preemption_state.stack, stacksize ); 324 if ( ret ) { 325 abort( "%s : internal error, pthread_attr_setstack failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) ); 326 } // if 327 328 ret = pthread_create( &alarm_thread, &attr, alarm_loop, 0p ); 329 if ( ret ) { 330 abort( "%s : internal error, pthread_create failed, error(%d) %s.", __PRETTY_FUNCTION__, ret, strerror( ret ) ); 331 } // if 308 kernelTLS.preemption_state.stack = create_pthread( &alarm_thread, alarm_loop, 0p ); 332 309 } 333 310
Note:
See TracChangeset
for help on using the changeset viewer.