Staging
v0.8.1
https://github.com/python/cpython
Revision 6eb2878e42152e9c45d7ee5e6f889532d753e67c authored by Miss Islington (bot) on 13 June 2019, 12:22:20 UTC, committed by Victor Stinner on 13 June 2019, 12:22:20 UTC
* bpo-36402: Fix threading._shutdown() race condition (GH-13948)

Fix a race condition at Python shutdown when waiting for threads.
Wait until the Python thread state of all non-daemon threads get
deleted (join all non-daemon threads), rather than just wait until
Python threads complete.

* Add threading._shutdown_locks: set of Thread._tstate_lock locks
  of non-daemon threads used by _shutdown() to wait until all Python
  thread states get deleted. See Thread._set_tstate_lock().
* Add also threading._shutdown_locks_lock to protect access to
  threading._shutdown_locks.
* Add test_finalization_shutdown() test.

(cherry picked from commit 468e5fec8a2f534f1685d59da3ca4fad425c38dd)

* bpo-36402: Fix threading.Thread._stop() (GH-14047)

Remove the _tstate_lock from _shutdown_locks, don't remove None.

(cherry picked from commit 6f75c873752a16a7ad8f35855b1e29f59d048e84)
(cherry picked from commit e40a97a721d46307dfdc2b0322028ccded6eb571)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
1 parent b4c8ef7
History
Tip revision: 6eb2878e42152e9c45d7ee5e6f889532d753e67c authored by Miss Islington (bot) on 13 June 2019, 12:22:20 UTC
bpo-36402: Fix threading._shutdown() race condition (GH-13948) (GH-14050) (GH-14054)
Tip revision: 6eb2878
File Mode Size
_blake2
_ctypes
_decimal
_io
_multiprocessing
_sha3
_sqlite
_xxtestfuzz
cjkcodecs
clinic
expat
README -rw-r--r-- 112 bytes
Setup.dist -rw-r--r-- 14.2 KB
_abc.c -rw-r--r-- 21.8 KB
_asynciomodule.c -rw-r--r-- 85.7 KB
_bisectmodule.c -rw-r--r-- 7.1 KB
_bz2module.c -rw-r--r-- 24.3 KB
_codecsmodule.c -rw-r--r-- 34.7 KB
_collectionsmodule.c -rw-r--r-- 73.3 KB
_contextvarsmodule.c -rw-r--r-- 1.9 KB
_cryptmodule.c -rw-r--r-- 1.5 KB
_csv.c -rw-r--r-- 49.4 KB
_curses_panel.c -rw-r--r-- 14.2 KB
_cursesmodule.c -rw-r--r-- 101.8 KB
_datetimemodule.c -rw-r--r-- 210.2 KB
_dbmmodule.c -rw-r--r-- 13.5 KB
_elementtree.c -rw-r--r-- 114.7 KB
_functoolsmodule.c -rw-r--r-- 43.1 KB
_gdbmmodule.c -rw-r--r-- 18.3 KB
_hashopenssl.c -rw-r--r-- 30.3 KB
_heapqmodule.c -rw-r--r-- 20.9 KB
_json.c -rw-r--r-- 60.0 KB
_localemodule.c -rw-r--r-- 19.4 KB
_lsprof.c -rw-r--r-- 26.8 KB
_lzmamodule.c -rw-r--r-- 46.6 KB
_math.c -rw-r--r-- 7.3 KB
_math.h -rw-r--r-- 1007 bytes
_opcode.c -rw-r--r-- 1.7 KB
_operator.c -rw-r--r-- 47.5 KB
_pickle.c -rw-r--r-- 213.5 KB
_posixsubprocess.c -rw-r--r-- 26.3 KB
_queuemodule.c -rw-r--r-- 11.9 KB
_randommodule.c -rw-r--r-- 16.7 KB
_scproxy.c -rw-r--r-- 6.0 KB
_sre.c -rw-r--r-- 76.2 KB
_ssl.c -rw-r--r-- 184.1 KB
_ssl_data.h -rw-r--r-- 67.9 KB
_stat.c -rw-r--r-- 15.4 KB
_struct.c -rw-r--r-- 64.0 KB
_testbuffer.c -rw-r--r-- 82.1 KB
_testcapimodule.c -rw-r--r-- 156.5 KB
_testimportmultiple.c -rw-r--r-- 1.1 KB
_testmultiphase.c -rw-r--r-- 17.2 KB
_threadmodule.c -rw-r--r-- 43.6 KB
_tkinter.c -rw-r--r-- 91.3 KB
_tracemalloc.c -rw-r--r-- 42.3 KB
_uuidmodule.c -rw-r--r-- 1.7 KB
_weakref.c -rw-r--r-- 4.5 KB
_winapi.c -rw-r--r-- 53.4 KB
addrinfo.h -rw-r--r-- 5.9 KB
arraymodule.c -rw-r--r-- 87.9 KB
atexitmodule.c -rw-r--r-- 8.9 KB
audioop.c -rw-r--r-- 57.2 KB
binascii.c -rw-r--r-- 51.7 KB
cmathmodule.c -rw-r--r-- 42.2 KB
config.c.in -rw-r--r-- 1.6 KB
errnomodule.c -rw-r--r-- 28.1 KB
faulthandler.c -rw-r--r-- 38.4 KB
fcntlmodule.c -rw-r--r-- 19.5 KB
gc_weakref.txt -rw-r--r-- 11.2 KB
gcmodule.c -rw-r--r-- 55.8 KB
getaddrinfo.c -rw-r--r-- 18.4 KB
getbuildinfo.c -rw-r--r-- 1.3 KB
getnameinfo.c -rw-r--r-- 6.2 KB
getpath.c -rw-r--r-- 30.6 KB
grpmodule.c -rw-r--r-- 6.2 KB
hashlib.h -rw-r--r-- 2.1 KB
hashtable.c -rw-r--r-- 14.1 KB
hashtable.h -rw-r--r-- 6.2 KB
itertoolsmodule.c -rw-r--r-- 145.7 KB
ld_so_aix.in -rw-r--r-- 6.1 KB
main.c -rw-r--r-- 81.4 KB
makesetup -rwxr-xr-x 7.7 KB
makexp_aix -rwxr-xr-x 3.2 KB
mathmodule.c -rw-r--r-- 71.6 KB
md5module.c -rw-r--r-- 15.0 KB
mmapmodule.c -rw-r--r-- 43.1 KB
nismodule.c -rw-r--r-- 11.6 KB
ossaudiodev.c -rw-r--r-- 36.2 KB
overlapped.c -rw-r--r-- 41.6 KB
parsermodule.c -rw-r--r-- 39.9 KB
posixmodule.c -rw-r--r-- 349.1 KB
posixmodule.h -rw-r--r-- 553 bytes
pwdmodule.c -rw-r--r-- 6.0 KB
pyexpat.c -rw-r--r-- 60.1 KB
readline.c -rw-r--r-- 37.3 KB
resource.c -rw-r--r-- 12.4 KB
rotatingtree.c -rw-r--r-- 3.4 KB
rotatingtree.h -rw-r--r-- 924 bytes
selectmodule.c -rw-r--r-- 76.1 KB
sha1module.c -rw-r--r-- 14.1 KB
sha256module.c -rw-r--r-- 22.2 KB
sha512module.c -rw-r--r-- 27.5 KB
signalmodule.c -rw-r--r-- 41.5 KB
socketmodule.c -rw-r--r-- 230.0 KB
socketmodule.h -rw-r--r-- 7.1 KB
spwdmodule.c -rw-r--r-- 5.9 KB
sre.h -rw-r--r-- 2.8 KB
sre_constants.h -rw-r--r-- 2.8 KB
sre_lib.h -rw-r--r-- 52.2 KB
symtablemodule.c -rw-r--r-- 2.8 KB
syslogmodule.c -rw-r--r-- 9.4 KB
termios.c -rw-r--r-- 20.4 KB
testcapi_long.h -rw-r--r-- 6.8 KB
timemodule.c -rw-r--r-- 51.2 KB
tkappinit.c -rw-r--r-- 4.7 KB
tkinter.h -rw-r--r-- 881 bytes
unicodedata.c -rw-r--r-- 40.9 KB
unicodedata_db.h -rw-r--r-- 518.3 KB
unicodename_db.h -rw-r--r-- 2.0 MB
winreparse.h -rw-r--r-- 1.4 KB
xxlimited.c -rw-r--r-- 6.9 KB
xxmodule.c -rw-r--r-- 12.5 KB
xxsubtype.c -rw-r--r-- 10.7 KB
zipimport.c -rw-r--r-- 48.7 KB
zlibmodule.c -rw-r--r-- 40.2 KB

README

back to top