Commit 9743c55
bpo-37266: Daemon threads are now denied in subinterpreters (pythonGH-14049)
In a subinterpreter, spawning a daemon thread now raises an
exception. Daemon threads were never supported in subinterpreters.
Previously, the subinterpreter finalization crashed with a Pyton
fatal error if a daemon thread was still running.
* Add _thread._is_main_interpreter()
* threading.Thread.start() now raises RuntimeError if the thread is a
daemon thread and the method is called from a subinterpreter.
* The _thread module now uses Argument Clinic for the new function.
* Use textwrap.dedent() in test_threading.SubinterpThreadingTests1 parent a80864d commit 9743c55
File tree
8 files changed
+113
-29
lines changed- Doc
- library
- whatsnew
- Lib
- test
- Misc/NEWS.d/next/Library
- Modules
- clinic
8 files changed
+113
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
| 283 | + | |
| 284 | + | |
283 | 285 | | |
284 | 286 | | |
285 | 287 | | |
| |||
294 | 296 | | |
295 | 297 | | |
296 | 298 | | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
297 | 305 | | |
298 | 306 | | |
299 | 307 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
89 | 97 | | |
90 | 98 | | |
91 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
928 | 929 | | |
929 | 930 | | |
930 | 931 | | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
931 | 939 | | |
932 | 940 | | |
933 | 941 | | |
934 | 942 | | |
935 | | - | |
936 | | - | |
937 | | - | |
938 | | - | |
| 943 | + | |
| 944 | + | |
939 | 945 | | |
940 | 946 | | |
941 | 947 | | |
| |||
953 | 959 | | |
954 | 960 | | |
955 | 961 | | |
956 | | - | |
| 962 | + | |
957 | 963 | | |
958 | 964 | | |
959 | 965 | | |
| |||
964 | 970 | | |
965 | 971 | | |
966 | 972 | | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
| 973 | + | |
| 974 | + | |
971 | 975 | | |
972 | 976 | | |
973 | 977 | | |
| |||
992 | 996 | | |
993 | 997 | | |
994 | 998 | | |
995 | | - | |
| 999 | + | |
996 | 1000 | | |
997 | 1001 | | |
998 | 1002 | | |
999 | 1003 | | |
1000 | 1004 | | |
1001 | | - | |
1002 | | - | |
1003 | | - | |
1004 | | - | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
1005 | 1008 | | |
1006 | | - | |
| 1009 | + | |
1007 | 1010 | | |
1008 | | - | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
1016 | 1027 | | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1023 | 1031 | | |
1024 | 1032 | | |
1025 | 1033 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
846 | 847 | | |
847 | 848 | | |
848 | 849 | | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
849 | 855 | | |
850 | 856 | | |
851 | 857 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
11 | 19 | | |
12 | 20 | | |
13 | 21 | | |
| |||
1442 | 1450 | | |
1443 | 1451 | | |
1444 | 1452 | | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
| 1466 | + | |
| 1467 | + | |
1445 | 1468 | | |
1446 | 1469 | | |
1447 | 1470 | | |
| |||
1471 | 1494 | | |
1472 | 1495 | | |
1473 | 1496 | | |
| 1497 | + | |
1474 | 1498 | | |
1475 | 1499 | | |
1476 | 1500 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments