mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
8289610: Degrade Thread.stop
Reviewed-by: rriggs, cjplummer, jpai, mchung, prr, mullan
This commit is contained in:
parent
05c8cabdad
commit
acd5bcfc88
26 changed files with 179 additions and 226 deletions
|
@ -190,17 +190,9 @@ public class FilterOutputStream extends OutputStream {
|
|||
try {
|
||||
out.close();
|
||||
} catch (Throwable closeException) {
|
||||
// evaluate possible precedence of flushException over closeException
|
||||
if ((flushException instanceof ThreadDeath) &&
|
||||
!(closeException instanceof ThreadDeath)) {
|
||||
flushException.addSuppressed(closeException);
|
||||
throw (ThreadDeath) flushException;
|
||||
}
|
||||
|
||||
if (flushException != closeException) {
|
||||
closeException.addSuppressed(flushException);
|
||||
}
|
||||
|
||||
throw closeException;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2430,8 +2430,6 @@ public class ObjectInputStream
|
|||
// Read fields of the current descriptor into a new FieldValues and discard
|
||||
new FieldValues(slotDesc, true);
|
||||
} else if (slotDesc.hasReadObjectMethod()) {
|
||||
ThreadDeath t = null;
|
||||
boolean reset = false;
|
||||
SerialCallbackContext oldContext = curContext;
|
||||
if (oldContext != null)
|
||||
oldContext.check();
|
||||
|
@ -2450,19 +2448,10 @@ public class ObjectInputStream
|
|||
*/
|
||||
handles.markException(passHandle, ex);
|
||||
} finally {
|
||||
do {
|
||||
try {
|
||||
curContext.setUsed();
|
||||
if (oldContext!= null)
|
||||
oldContext.check();
|
||||
curContext = oldContext;
|
||||
reset = true;
|
||||
} catch (ThreadDeath x) {
|
||||
t = x; // defer until reset is true
|
||||
}
|
||||
} while (!reset);
|
||||
if (t != null)
|
||||
throw t;
|
||||
curContext.setUsed();
|
||||
if (oldContext!= null)
|
||||
oldContext.check();
|
||||
curContext = oldContext;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue