From 7e1335adbc4965e3f2b79eff2f947069876aa6c1 Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 30 Mar 2012 11:50:31 -0700 Subject: [PATCH] Fixed a synchronization bug --- .../com/todoroo/astrid/actfm/sync/ActFmSyncService.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java index 890a9ccb7..2d8bdbd41 100644 --- a/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java +++ b/astrid/plugin-src/com/todoroo/astrid/actfm/sync/ActFmSyncService.java @@ -139,8 +139,8 @@ public final class ActFmSyncService { new Thread(new Runnable() { @Override public void run() { - taskPushThreads.incrementAndGet(); waitUntilEmpty.close(); + taskPushThreads.incrementAndGet(); // sleep so metadata associated with task is saved try { AndroidUtilities.sleepDeep(1000L); @@ -248,9 +248,7 @@ public final class ActFmSyncService { } public void waitUntilEmpty() { - while (taskPushThreads.get() > 0) { - waitUntilEmpty.block(); - } + waitUntilEmpty.block(); } // --- data push methods