This repository has been archived on 2025-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
PyBitmessage-2025-02-02/src/class_asyncoreThread.py

20 lines
587 B
Python
Raw Normal View History

2013-07-03 14:35:35 +02:00
import asyncore
import shared
import threading
2013-07-03 16:01:11 +02:00
2013-07-03 14:35:35 +02:00
class asyncoreThread(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
def run(self):
shared.printLock.acquire()
print "Asyncore thread started"
shared.printLock.release()
while True:
asyncore.loop(timeout=1) # Despite the horrible parameter name, this function will not timeout until all channels are closed.
shared.printLock.acquire()
print("all asyncore modules dead!")
shared.printLock.release()