Add thread counter debugger
This commit is contained in:
parent
e2c7a7f9a1
commit
7963bc56ea
@ -182,11 +182,29 @@ class inThread(threading.Thread):
|
||||
self.closeThread()
|
||||
raise
|
||||
|
||||
class debugThread(threading.Thread):
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
with threadsLock:
|
||||
print("Threads - IN: " +str(len(inThreads)))
|
||||
print("Threads - OUT: " +str(len(outThreads)))
|
||||
time.sleep(10)
|
||||
|
||||
def main():
|
||||
global threadId
|
||||
serverSocket.bind(serverAddr)
|
||||
serverSocket.listen(1024)
|
||||
|
||||
# DEBUG
|
||||
global time
|
||||
import time
|
||||
debug = debugThread()
|
||||
debug.start()
|
||||
# DEBUG END
|
||||
|
||||
while True:
|
||||
connection, address = serverSocket.accept()
|
||||
connection.settimeout(15)
|
||||
|
Loading…
Reference in New Issue
Block a user