Changeset a83ffa4 for src/libcfa/concurrency/preemption.c
- Timestamp:
- May 18, 2018, 3:24:12 PM (6 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, with_gc
- Children:
- cb6314e
- Parents:
- b1a4300
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/libcfa/concurrency/preemption.c
rb1a4300 ra83ffa4 15 15 16 16 #include "preemption.h" 17 #include <assert.h> 17 18 18 19 extern "C" { … … 350 351 kernelTLS.preemption_state.in_progress = true; 351 352 352 // We are about to CtxSwitch out of the signal handler, let other handlers in 353 signal_unblock( SIGUSR1 ); 353 // Clear sighandler mask before context switching. 354 static_assert( sizeof( sigset_t ) == sizeof( cxt->uc_sigmask ), "Expected cxt->uc_sigmask to be of sigset_t" ); 355 if ( pthread_sigmask( SIG_SETMASK, (sigset_t *)&(cxt->uc_sigmask), NULL ) == -1 ) { 356 abort( "internal error, sigprocmask" ); 357 } 354 358 355 359 // TODO: this should go in finish action … … 435 439 sigset_t oldset; 436 440 int ret; 437 ret = sigprocmask(0, NULL, &oldset);441 ret = pthread_sigmask(0, NULL, &oldset); 438 442 if(ret != 0) { abort("ERROR sigprocmask returned %d", ret); } 439 443 440 444 ret = sigismember(&oldset, SIGUSR1); 441 445 if(ret < 0) { abort("ERROR sigismember returned %d", ret); } 442 443 446 if(ret == 1) { abort("ERROR SIGUSR1 is disabled"); } 447 448 ret = sigismember(&oldset, SIGALRM); 449 if(ret < 0) { abort("ERROR sigismember returned %d", ret); } 450 if(ret == 0) { abort("ERROR SIGALRM is enabled"); } 451 452 ret = sigismember(&oldset, SIGTERM); 453 if(ret < 0) { abort("ERROR sigismember returned %d", ret); } 454 if(ret == 1) { abort("ERROR SIGTERM is disabled"); } 444 455 } 445 456
Note: See TracChangeset
for help on using the changeset viewer.