For every client connecting to my server I spawn a new thread, like this:
# Create a new client
c = Client(self.server.accept(), globQueue[globQueueIndex], globQueueIndex, serverQueue )
# Start it
c.start()
# And thread it
self.threads.append(c)
Now, I know I can close all the threads using this code:
# Loop through all the threads and close (join) them
for c in self.threads:
c.join()
But how can I close the thread from within that thread?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…