Changeset cd17862 for src/libcfa/concurrency/kernel.c
- Timestamp:
- Jul 4, 2017, 4:48:46 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:
- 11dbfe1
- Parents:
- 47ecf2b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/kernel.c
r47ecf2b rcd17862 324 324 LIB_DEBUG_PRINT_SAFE("Kernel : Starting core %p\n", this); 325 325 326 // SIGALRM must only be caught by the system processor327 sigset_t old_mask;328 bool is_system_proc = this_processor == &systemProcessor->proc;329 if ( is_system_proc ) {330 // Child kernel-thread inherits the signal mask from the parent kernel-thread. So one special case for the331 // system processor creating the user processor => toggle the blocking SIGALRM on system processor, create user332 // processor, and toggle back (below) previous signal mask of the system processor.333 334 sigset_t new_mask;335 sigemptyset( &new_mask );336 sigemptyset( &old_mask );337 sigaddset( &new_mask, SIGALRM );338 339 if ( pthread_sigmask( SIG_BLOCK, &new_mask, &old_mask ) == -1 ) {340 abortf( "internal error, pthread_sigmask" );341 }342 343 assert( ! sigismember( &old_mask, SIGALRM ) );344 }345 346 326 pthread_create( &this->kernel_thread, NULL, CtxInvokeProcessor, (void*)this ); 347 348 // Toggle back previous signal mask of system processor.349 if ( is_system_proc ) {350 if ( pthread_sigmask( SIG_SETMASK, &old_mask, NULL ) == -1 ) {351 abortf( "internal error, pthread_sigmask" );352 } // if353 } // if354 327 355 328 LIB_DEBUG_PRINT_SAFE("Kernel : core %p started\n", this);
Note: See TracChangeset
for help on using the changeset viewer.