Skip to content

Commit

Permalink
Remove unnecessary write barrier
Browse files Browse the repository at this point in the history
At the end of registerSignalHandlerWithOS, a write barrier is issued
before updating signalsWithHandlers. According to the comment, the write
barrier is required since registerHandlerMonitor isn't acquired.

registerSignalHandlerWithOS is invoked from:
1) registerMasterHandlers
2) omrsig_register_os_handler [registerHandlerMonitor acquired]

registerMasterHandlers is invoked from:
1) omrsig_protect [registerHandlerMonitor acquired]
2) omrsig_set_async_signal_handler [registerHandlerMonitor acquired]
3) omrsig_set_single_async_signal_handler [registerHandlerMonitor
acquired]

I have confirmed that registerHandlerMonitor is acquired for every call
to registerSignalHandlerWithOS. So, the write barrier is no longer
needed.

Signed-off-by: Babneet Singh <sbabneet@ca.ibm.com>
  • Loading branch information
babsingh committed May 4, 2018
1 parent 4bc5a17 commit bbc8b5e
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions port/unix/omrsignal.c
Original file line number Diff line number Diff line change
Expand Up @@ -1250,9 +1250,6 @@ registerSignalHandlerWithOS(OMRPortLibrary *portLibrary, uint32_t portLibrarySig
}
}

/* CMVC 96193 signalsWithHandlers is checked without acquiring the registerHandlerMonitor */
issueWriteBarrier();

/* we've successfully registered the handler for this, record it! */
signalsWithHandlers |= portLibrarySignalNo;

Expand Down

0 comments on commit bbc8b5e

Please sign in to comment.