Changeset 169d944 for src/libcfa/concurrency/preemption.c
- Timestamp:
- Feb 8, 2018, 4:52:09 PM (7 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
- Children:
- 06b176d
- Parents:
- 3f8ab8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/preemption.c
r3f8ab8f r169d944 10 10 // Created On : Mon Jun 5 14:20:42 2017 11 11 // Last Modified By : Peter A. Buhr 12 // Last Modified On : T ue Feb 6 15:00:36201813 // Update Count : 1 012 // Last Modified On : Thu Feb 8 16:12:58 2018 13 // Update Count : 12 14 14 // 15 15 … … 192 192 193 193 if ( pthread_sigmask( SIG_UNBLOCK, &mask, NULL ) == -1 ) { 194 abort f( "internal error, pthread_sigmask" );194 abort( "internal error, pthread_sigmask" ); 195 195 } 196 196 } … … 203 203 204 204 if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) { 205 abort f( "internal error, pthread_sigmask" );205 abort( "internal error, pthread_sigmask" ); 206 206 } 207 207 } … … 234 234 // Called from kernel_startup 235 235 void kernel_start_preemption() { 236 __cfaabi_dbg_print_safe( "Kernel : Starting preemption\n");236 __cfaabi_dbg_print_safe( "Kernel : Starting preemption\n" ); 237 237 238 238 // Start with preemption disabled until ready … … 255 255 // Called from kernel_shutdown 256 256 void kernel_stop_preemption() { 257 __cfaabi_dbg_print_safe( "Kernel : Preemption stopping\n");257 __cfaabi_dbg_print_safe( "Kernel : Preemption stopping\n" ); 258 258 259 259 // Block all signals since we are already shutting down … … 271 271 // Preemption is now fully stopped 272 272 273 __cfaabi_dbg_print_safe( "Kernel : Preemption stopped\n");273 __cfaabi_dbg_print_safe( "Kernel : Preemption stopped\n" ); 274 274 } 275 275 … … 302 302 if( !preemption_ready() ) { return; } 303 303 304 __cfaabi_dbg_print_buffer_decl( " KERNEL: preempting core %p (%p).\n", this_processor, this_thread);304 __cfaabi_dbg_print_buffer_decl( " KERNEL: preempting core %p (%p).\n", this_processor, this_thread); 305 305 306 306 preemption_in_progress = true; // Sync flag : prevent recursive calls to the signal handler … … 322 322 323 323 if ( pthread_sigmask( SIG_BLOCK, &mask, NULL ) == -1 ) { 324 abort f( "internal error, pthread_sigmask" );324 abort( "internal error, pthread_sigmask" ); 325 325 } 326 326 … … 339 339 continue; 340 340 case EINVAL : 341 abort f("Timeout was invalid.");341 abort( "Timeout was invalid." ); 342 342 default: 343 abort f("Unhandled error %d", err);343 abort( "Unhandled error %d", err); 344 344 } 345 345 } … … 348 348 assertf(sig == SIGALRM, "Kernel Internal Error, sigwait: Unexpected signal %d (%d : %d)\n", sig, info.si_code, info.si_value.sival_int); 349 349 350 // __cfaabi_dbg_print_safe( "Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int );350 // __cfaabi_dbg_print_safe( "Kernel : Caught alarm from %d with %d\n", info.si_code, info.si_value.sival_int ); 351 351 // Switch on the code (a.k.a. the sender) to 352 352 switch( info.si_code ) … … 356 356 case SI_TIMER: 357 357 case SI_KERNEL: 358 // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n");358 // __cfaabi_dbg_print_safe( "Kernel : Preemption thread tick\n" ); 359 359 lock( event_kernel->lock __cfaabi_dbg_ctx2 ); 360 360 tick_preemption(); … … 370 370 371 371 EXIT: 372 __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n");372 __cfaabi_dbg_print_safe( "Kernel : Preemption thread stopping\n" ); 373 373 return NULL; 374 374 }
Note: See TracChangeset
for help on using the changeset viewer.