Use ReentrantLock as a lock (not a monitor) when marking DB as open.

This commit is contained in:
akwizgran
2021-11-17 15:03:58 +00:00
parent 1b4ab4f945
commit 6c702bad0a

View File

@@ -429,8 +429,11 @@ abstract class JdbcDatabase implements Database<Connection> {
compactAndClose();
logDuration(LOG, "Compacting database", start);
// Allow the next transaction to reopen the DB
synchronized (connectionsLock) {
connectionsLock.lock();
try {
closed = false;
} finally {
connectionsLock.unlock();
}
txn = startTransaction();
try {