Skip to content

Commit

Permalink
Unblock synchronous signal if it is used
Browse files Browse the repository at this point in the history
Allow synchronous signals to get unblocked when
a signal handler is set for them.

Issue: eclipse-openj9/openj9#10744

Signed-off-by: Abdulrahman Alattas <rmnattas@gmail.com>
  • Loading branch information
rmnattas committed Jan 6, 2021
1 parent 582366a commit 9e40795
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions port/unix/omrsignal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1269,16 +1269,14 @@ registerSignalHandlerWithOS(OMRPortLibrary *portLibrary, uint32_t portLibrarySig
return OMRPORT_SIG_ERROR;
}

/* If a process has blocked an asynchronous signal, then the signal stays
* blocked in the sub-processes across fork(s) and exec(s). A blocked
/* If a process has blocked a signal, then the signal stays blocked
* in the sub-processes across fork(s) and exec(s). A blocked
* signal prevents its OS signal handler to be invoked. A signal is
* unblocked as an OS signal handler is installed for it in case a
* parent process has blocked it.
*/
if (OMR_ARE_ALL_BITS_SET(OMRPORT_SIG_FLAG_SIGALLASYNC, portLibrarySignalNo)) {
if (0 != unblockSignal(unixSignalNo)) {
return OMRPORT_SIG_ERROR;
}
if (0 != unblockSignal(unixSignalNo)) {
return OMRPORT_SIG_ERROR;
}

memset(&newAction, 0, sizeof(struct sigaction));
Expand Down

0 comments on commit 9e40795

Please sign in to comment.