DebugClients/Python2/DebugClientThreads.py

changeset 5161
f7b6ded9cc37
parent 5133
b7fe69c6cb1c
diff -r d8908660fc65 -r f7b6ded9cc37 DebugClients/Python2/DebugClientThreads.py
--- a/DebugClients/Python2/DebugClientThreads.py	Sat Sep 10 19:32:56 2016 +0200
+++ b/DebugClients/Python2/DebugClientThreads.py	Sun Sep 11 13:11:58 2016 +0200
@@ -74,20 +74,21 @@
         
         self.variant = 'Threaded'
 
-    def attachThread(self, target=None, args=None, kwargs=None, mainThread=0):
+    def attachThread(self, target=None, args=None, kwargs=None,
+                     mainThread=False):
         """
         Public method to setup a thread for DebugClient to debug.
         
-        If mainThread is non-zero, then we are attaching to the already
+        If mainThread is True, then we are attaching to the already
         started mainthread of the app and the rest of the args are ignored.
         
         @param target the start function of the target thread (i.e. the
             user code)
         @param args arguments to pass to target
         @param kwargs keyword arguments to pass to target
-        @param mainThread non-zero, if we are attaching to the already
+        @param mainThread True, if we are attaching to the already
               started mainthread of the app
-        @return The identifier of the created thread
+        @return identifier of the created thread
         """
         try:
             self.lockClient()
@@ -123,12 +124,14 @@
         finally:
             self.unlockClient()
             
-    def lockClient(self, blocking=1):
+    def lockClient(self, blocking=True):
         """
         Public method to acquire the lock for this client.
         
         @param blocking flag to indicating a blocking lock
+        @type bool
         @return flag indicating successful locking
+        @rtype bool
         """
         if blocking:
             self.clientLock.acquire()
@@ -179,7 +182,7 @@
         Public method to do a 'set quit' on all threads.
         """
         try:
-            locked = self.lockClient(0)
+            locked = self.lockClient(False)
             try:
                 for key in self.threads.keys():
                     self.threads[key].set_quit()

eric ide

mercurial