[Pcsclite-cvs-commit] r5583 - /trunk/PCSC/UnitaryTests/ThreadSafe.py

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Feb 4 18:16:25 UTC 2011


Author: rousseau
Date: Fri Feb  4 18:16:11 2011
New Revision: 5583

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5583
Log:
Display the thread id and iterations

Modified:
    trunk/PCSC/UnitaryTests/ThreadSafe.py

Modified: trunk/PCSC/UnitaryTests/ThreadSafe.py
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/UnitaryTests/ThreadSafe.py?rev=5583&op=diff
==============================================================================
--- trunk/PCSC/UnitaryTests/ThreadSafe.py (original)
+++ trunk/PCSC/UnitaryTests/ThreadSafe.py Fri Feb  4 18:16:11 2011
@@ -29,11 +29,13 @@
 MAX_ITER = 10
 
 
-def stress():
+def stress(*args):
     """
     stress method
     """
+    thread = args[0]
     for j in range(1, MAX_ITER):
+        print thread,
         hresult, hcontext = SCardEstablishContext(SCARD_SCOPE_USER)
         if hresult != SCARD_S_SUCCESS:
             raise EstablishContextException(hresult)
@@ -51,8 +53,9 @@
     threads = list()
 
     for i in range(1, MAX_THREADS):
-        thread = threading.Thread(target=stress)
+        thread = threading.Thread(target=stress, args=(i,))
         threads.append(thread)
+        print "start thread", i
         thread.start()
 
     for thread in threads:




More information about the Pcsclite-cvs-commit mailing list