1
0
Fork 0
mirror of https://github.com/dbarzin/pandora-box.git synced 2025-07-18 21:09:41 +02:00

add threading

This commit is contained in:
dbarzin 2023-03-04 17:51:50 +01:00
parent f1b9342f98
commit c265840ca2
2 changed files with 755 additions and 642 deletions

File diff suppressed because it is too large Load diff

View file

@ -15,17 +15,16 @@ class myThread (threading.Thread):
def run(self):
print(f"Thread-{self.id} Starting ")
process_data(self.id, self.q)
self.process_data()
print(f"Thread-{self.id} Done.")
def process_data(id, q):
def process_data(self):
while not exitFlag:
queueLock.acquire()
if not workQueue.empty():
data = q.get()
data = self.q.get()
queueLock.release()
print(f"Thread-{id} processing {data}")
print(f"Thread-{self.id} processing {data}")
else:
queueLock.release()
time.sleep(1)