mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 18:33:41 +00:00
8129952: Ensure thread consistency
Reviewed-by: alanb, ahgross, skoivu
This commit is contained in:
parent
11920c3315
commit
0aa59442eb
@ -1915,6 +1915,8 @@ public class ObjectInputStream
|
||||
if (obj == null || handles.lookupException(passHandle) != null) {
|
||||
defaultReadFields(null, slotDesc); // skip field values
|
||||
} else if (slotDesc.hasReadObjectMethod()) {
|
||||
ThreadDeath t = null;
|
||||
boolean reset = false;
|
||||
SerialCallbackContext oldContext = curContext;
|
||||
if (oldContext != null)
|
||||
oldContext.check();
|
||||
@ -1933,10 +1935,19 @@ public class ObjectInputStream
|
||||
*/
|
||||
handles.markException(passHandle, ex);
|
||||
} finally {
|
||||
curContext.setUsed();
|
||||
if (oldContext!= null)
|
||||
oldContext.check();
|
||||
curContext = oldContext;
|
||||
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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user