mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Don't call stopped.get() outside the lock.
This commit is contained in:
@@ -29,11 +29,12 @@ class DatabaseCleanerImpl implements DatabaseCleaner, Runnable {
|
|||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
try {
|
try {
|
||||||
while(!stopped.get()) {
|
while(true) {
|
||||||
if(callback.shouldCheckFreeSpace()) {
|
if(callback.shouldCheckFreeSpace()) {
|
||||||
callback.checkFreeSpaceAndClean();
|
callback.checkFreeSpaceAndClean();
|
||||||
} else {
|
} else {
|
||||||
synchronized(stopped) {
|
synchronized(stopped) {
|
||||||
|
if(stopped.get()) break;
|
||||||
try {
|
try {
|
||||||
stopped.wait(msBetweenSweeps);
|
stopped.wait(msBetweenSweeps);
|
||||||
} catch(InterruptedException ignored) {}
|
} catch(InterruptedException ignored) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user