How to close a thread from within?

后端 未结 4 1050
日久生厌
日久生厌 2020-12-02 14:16

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], g         


        
4条回答
  •  天涯浪人
    2020-12-02 14:50

    How about sys.exit() from the module sys.

    If sys.exit() is executed from within a thread it will close that thread only.

    This answer here talks about that: Why does sys.exit() not exit when called inside a thread in Python?

提交回复
热议问题