Skip to content

fixed blocking of shutdown in wildfly #236

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,19 @@ public void terminateThread() {
// Prepare a service context to be used by the UI thread that may continue
// to run as a result of the interrupt call
ServiceContext serviceContext = ContextUtil.createFakeContext( uiSession );
setServiceContext( serviceContext );
uiThreadTerminating = true;
// interrupt the UI thread that is expected to wait in switchThread or already be terminated
synchronized( getLock() ) {
getThread().interrupt();
}
try {
getThread().join();
} catch( InterruptedException e ) {
String msg = "Received InterruptedException while terminating UIThread";
ServletLog.log( msg, e );
setServiceContext( serviceContext );
while (getThread().isAlive()) {
uiThreadTerminating = true;
// interrupt the UI thread that is expected to wait in switchThread or already be terminated
synchronized( getLock() ) {
getThread().interrupt();
}
try {
getThread().join(5000);
} catch( InterruptedException e ) {
String msg = "Received InterruptedException while terminating UIThread";
ServletLog.log( msg, e );
}
}
uiThreadTerminating = false;
}
Expand Down