Merge branch 'fix-database-locking' into 'master'

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

See merge request briar/briar!1549
This commit is contained in:
Torsten Grote
2021-12-13 11:48:28 +00:00

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 {