mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-05 10:49:34 +02:00
GP-1072: Should grab the readlock before others if any reading is to be done.
This commit is contained in:
parent
7f50d8f430
commit
42395cbd37
1 changed files with 17 additions and 11 deletions
|
@ -525,22 +525,28 @@ public class DBTrace extends DBCachedDomainObjectAdapter implements Trace, Trace
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DBTraceProgramView getFixedProgramView(long snap) {
|
public DBTraceProgramView getFixedProgramView(long snap) {
|
||||||
synchronized (fixedProgramViews) {
|
// NOTE: The new viewport will need to read from the time manager during init
|
||||||
DBTraceProgramView view = fixedProgramViews.computeIfAbsent(snap, t -> {
|
try (LockHold hold = lockRead()) {
|
||||||
Msg.debug(this, "Creating fixed view at snap=" + snap);
|
synchronized (fixedProgramViews) {
|
||||||
return new DBTraceProgramView(this, snap, baseCompilerSpec);
|
DBTraceProgramView view = fixedProgramViews.computeIfAbsent(snap, t -> {
|
||||||
});
|
Msg.debug(this, "Creating fixed view at snap=" + snap);
|
||||||
return view;
|
return new DBTraceProgramView(this, snap, baseCompilerSpec);
|
||||||
|
});
|
||||||
|
return view;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DBTraceVariableSnapProgramView createProgramView(long snap) {
|
public DBTraceVariableSnapProgramView createProgramView(long snap) {
|
||||||
synchronized (programViews) {
|
// NOTE: The new viewport will need to read from the time manager during init
|
||||||
DBTraceVariableSnapProgramView view =
|
try (LockHold hold = lockRead()) {
|
||||||
new DBTraceVariableSnapProgramView(this, snap, baseCompilerSpec);
|
synchronized (programViews) {
|
||||||
programViews.put(view, null);
|
DBTraceVariableSnapProgramView view =
|
||||||
return view;
|
new DBTraceVariableSnapProgramView(this, snap, baseCompilerSpec);
|
||||||
|
programViews.put(view, null);
|
||||||
|
return view;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue