[Pcsclite-cvs-commit] r6582 - /trunk/PCSC/src/spy/pcsc-spy

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Fri Mar 29 19:42:28 UTC 2013


Author: rousseau
Date: Fri Mar 29 19:42:28 2013
New Revision: 6582

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=6582
Log:
Try to display the thread in the order they appear in the log

The idea is to schedule another thread when a thread change is detected
in the log. Then the other threads should have time to empty their
queues and display what they have to display.
The order is then respected between the logs recorded and the logs
displayed.

Modified:
    trunk/PCSC/src/spy/pcsc-spy

Modified: trunk/PCSC/src/spy/pcsc-spy
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/spy/pcsc-spy?rev=6582&op=diff
==============================================================================
--- trunk/PCSC/src/spy/pcsc-spy (original)
+++ trunk/PCSC/src/spy/pcsc-spy Fri Mar 29 19:42:28 2013
@@ -22,6 +22,7 @@
 
 import os
 import signal
+import time
 from Queue import Queue
 from threading import Thread
 from operator import attrgetter
@@ -841,7 +842,14 @@
         start_time = int(sec) + int(usec) / 1000000.
 
         while line != '':
+            previous_thread = thread
             (thread, tail) = line.split('@')
+
+            # in case the thread changes
+            if previous_thread != thread:
+                # schedule the other thread so it has time to emtpy its
+                # queue
+                time.sleep(.01)
 
             try:
                 queue = self.queues[thread]




More information about the Pcsclite-cvs-commit mailing list