[tor-commits] [orbot/master] remove synchronized - not needed, and causing blocking

n8fr8 at torproject.org n8fr8 at torproject.org
Thu Jun 5 15:15:59 UTC 2014


commit d6f5720f270778a9026f20b72da37bcc0362e3b1
Author: Nathan Freitas <nathan at freitas.net>
Date:   Wed Jun 4 23:52:28 2014 -0400

    remove synchronized - not needed, and causing blocking
---
 src/org/torproject/android/service/TorService.java |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/org/torproject/android/service/TorService.java b/src/org/torproject/android/service/TorService.java
index ff219f2..81453f1 100644
--- a/src/org/torproject/android/service/TorService.java
+++ b/src/org/torproject/android/service/TorService.java
@@ -1002,17 +1002,18 @@ public class TorService extends Service implements TorServiceConstants, TorConst
 		}
 		
 		
-		public synchronized void setTorProfile(int profile)  {
+		public void setTorProfile(int profile)  {
 		
-			if (profile == PROFILE_ON && currentStatus == STATUS_OFF)
+			if (currentStatus == STATUS_OFF)
         	{
         		
-        		currentStatus = STATUS_CONNECTING;
 	            sendCallbackStatusMessage (getString(R.string.status_starting_up));
 
 	            try
 	   		     {
 	   			   initTor();
+
+	        		currentStatus = STATUS_CONNECTING;
 	   		     }
 	   		     catch (Exception e)
 	   		     {				
@@ -1024,11 +1025,11 @@ public class TorService extends Service implements TorServiceConstants, TorConst
         	}
         	else
         	{
-        		currentStatus = STATUS_OFF;
 	            sendCallbackStatusMessage (getString(R.string.status_shutting_down));
 	          
 	            stopTor();
-	            
+
+        		currentStatus = STATUS_OFF;   
         	}
 		}
 		





More information about the tor-commits mailing list