Skip to content
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