aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/dynload_stub.c
diff options
context:
space:
mode:
authorMARUYAMA Norihiro <norihiro.maruyama@gmail.com>2020-11-02 08:51:04 +0900
committerGitHub <noreply@github.com>2020-11-01 18:51:04 -0500
commitc41559021213cfc9dc62a83fc63306b3bdc3e64b (patch)
tree2a8974f08a5fa31aa57d336b29f01dddd5df164c /Python/dynload_stub.c
parente662c398d87f136497f8ec672e83657ae3a599e0 (diff)
downloadcpython-c41559021213cfc9dc62a83fc63306b3bdc3e64b.tar.gz
cpython-c41559021213cfc9dc62a83fc63306b3bdc3e64b.zip
bpo-37193: remove thread objects which finished process its request (GH-13893)
* bpo-37193: remove the thread which finished process request from threads list * rename variable t to thread. * don't remove thread from list if it is daemon. * use lock to protect self._threads. * use finally block in case of exception from shutdown_request(). * check "not thread.daemon" before lock to avoid holding the lock if it's unnecessary. * fix the place of _threads_lock. * separate code to remove a current thread into a function. * check ValueError when removing thread. * fix wrong code which all instance shared same lock. * Extract thread management into a _Threads class to encapsulate atomic operations and separate concerns. * Replace multiple references of 'block_on_close' with one, avoiding the possibility that 'block_on_close' could change during the course of processing requests. Now, there's exactly one _threads object with behavior fixed for the duration. * Add docstrings to private classes. * Add test to ensure that a ThreadingTCPServer can be closed without serving any requests. * Use _NoThreads as the default value. Fixes AttributeError when server is closed without serving any requests. * Add blurb * Add test capturing failure. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Diffstat (limited to 'Python/dynload_stub.c')
0 files changed, 0 insertions, 0 deletions