Prevent race condition

This commit is contained in:
M66B 2021-12-07 10:40:51 +01:00
parent d1600ad188
commit 516da33f8c
1 changed files with 2 additions and 0 deletions

View File

@ -1331,6 +1331,8 @@ public class ServiceSynchronize extends ServiceBase implements SharedPreferences
db.account().setAccountBackoff(account.id, null);
while (state.isRunning() && currentThread.equals(accountThread)) {
state.reset();
if (!state.isRunning())
break;
Log.i(account.name + " run thread=" + currentThread);
final ObjectHolder<TwoStateOwner> cowner = new ObjectHolder<>();