Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSC-139] fixing deadlock - moving controller.removeMonitorNoCallback() ... #28

Merged
merged 2 commits into from
Jan 21, 2014

Conversation

ropalka
Copy link
Contributor

@ropalka ropalka commented Dec 19, 2013

...out of synchronized section

@@ -105,6 +104,9 @@ public void addController(final ServiceController<?> controller) {
if (controller == null) return;
final ServiceControllerImpl<?> serviceController = (ServiceControllerImpl<?>) controller;
synchronized (controllersLock) {
while (cleanupInProgress) {
try { controllersLock.wait(); } catch (final InterruptedException ignored) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interruption cannot simply be ignored. If the thread is interrupted, then at the very least, interruption status should be restored on exit. I usually do something like this:

boolean intr = false;
try {
    ....
    try { xx.wait(); } catch (InterruptedException ignored) { intr = true; }
    ....
    try { xx.wait(); } catch (InterruptedException ignored) { intr = true; }
} finally {
    if (intr) Thread.currentThread().interrupt();
}

@dmlloyd dmlloyd merged commit 72b1202 into jboss-msc:1.1 Jan 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants