提交 aa840b1e authored 作者: Thomas Mueller's avatar Thomas Mueller

Slightly improved performance if the table is already locked.

上级 895fa225
...@@ -57,7 +57,7 @@ import org.h2.value.Value; ...@@ -57,7 +57,7 @@ import org.h2.value.Value;
public class TableData extends Table implements RecordReader { public class TableData extends Table implements RecordReader {
private RowIndex scanIndex; private RowIndex scanIndex;
private long rowCount; private long rowCount;
private Session lockExclusive; private volatile Session lockExclusive;
private HashSet<Session> lockShared = New.hashSet(); private HashSet<Session> lockShared = New.hashSet();
private Trace traceLock; private Trace traceLock;
private boolean globalTemporary; private boolean globalTemporary;
...@@ -428,6 +428,9 @@ public class TableData extends Table implements RecordReader { ...@@ -428,6 +428,9 @@ public class TableData extends Table implements RecordReader {
return; return;
} }
} }
if (lockExclusive == session) {
return;
}
synchronized (database) { synchronized (database) {
try { try {
doLock(session, lockMode, exclusive); doLock(session, lockMode, exclusive);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论