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

[tor-commits] [flashproxy/master] Don't hold the registration lock while registration is happening.



commit dcfe508ec921df23e2fc4464c40c5d636d8881dd
Author: David Fifield <david@xxxxxxxxxxxxxxx>
Date:   Sun Sep 23 18:33:53 2012 -0700

    Don't hold the registration lock while registration is happening.
    
    Do it only for the sake of waking up when the parent thread calls
    register.
---
 flashproxy-client |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/flashproxy-client b/flashproxy-client
index efdfafe..83f620a 100755
--- a/flashproxy-client
+++ b/flashproxy-client
@@ -678,11 +678,11 @@ def register_one():
         log("Registration helper ended with status %d." % p.returncode)
 
 def registration_thread_func():
-    register_condvar.acquire()
     while True:
+        register_condvar.acquire()
         register_condvar.wait()
+        register_condvar.release()
         register_one()
-    register_condvar.release()
 
 def proxy_chunk_local_to_remote(local, remote, data = None):
     if data is None:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits