[tomboy] Use AutoResetEvent instead of deprecated suspend



commit bd13c94c621e5f9d6fa94adece61d54159581c4f
Author: Aaron Borden <adborden live com>
Date:   Sun Dec 11 15:55:16 2011 -0800

    Use AutoResetEvent instead of deprecated suspend
    
    https://bugs.launchpad.net/tomboy/+bug/564262

 Tomboy/Synchronization/SyncManager.cs |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy/Synchronization/SyncManager.cs b/Tomboy/Synchronization/SyncManager.cs
index 1bd7e1a..4e44ec0 100644
--- a/Tomboy/Synchronization/SyncManager.cs
+++ b/Tomboy/Synchronization/SyncManager.cs
@@ -117,6 +117,7 @@ namespace Tomboy.Sync
 
 	public class SyncManager
 	{
+		private static AutoResetEvent suspendEvent = new AutoResetEvent(false);
 		private static ISyncUI syncUI;
 		private static SyncClient client;
 		private static SyncState state = SyncState.Idle;
@@ -377,6 +378,7 @@ namespace Tomboy.Sync
 		{
 			SyncServiceAddin addin = null;
 			SyncServer server = null;
+			suspendEvent.Reset();
 			try {
 
 				addin = GetConfiguredSyncService ();
@@ -463,7 +465,7 @@ namespace Tomboy.Sync
 
 								// Suspend this thread while the GUI is presented to
 								// the user.
-								syncThread.Suspend ();
+								suspendEvent.WaitOne();
 							}
 						}
 					}
@@ -506,7 +508,7 @@ namespace Tomboy.Sync
 
 							// Suspend this thread while the GUI is presented to
 							// the user.
-							syncThread.Suspend ();
+							suspendEvent.WaitOne();
 						}
 
 						// Note has been deleted or okay'd for overwrite
@@ -648,7 +650,7 @@ namespace Tomboy.Sync
 		{
 			if (syncThread != null) {
 				conflictResolution = resolution;
-				syncThread.Resume ();
+				suspendEvent.Set();
 			}
 		}
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]