Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
9939cc89
Kaydet (Commit)
9939cc89
authored
Agu 30, 2013
tarafından
Charles-François Natali
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #18418: After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
üst
dee0434e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
1 deletion
+26
-1
test_threading.py
Lib/test/test_threading.py
+21
-0
threading.py
Lib/threading.py
+1
-1
ACKS
Misc/ACKS
+1
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/test/test_threading.py
Dosyayı görüntüle @
9939cc89
...
...
@@ -444,6 +444,27 @@ class ThreadTests(BaseTestCase):
self
.
assertEqual
(
out
,
b
''
)
self
.
assertEqual
(
err
,
b
''
)
@unittest.skipUnless
(
hasattr
(
os
,
'fork'
),
"needs os.fork()"
)
def
test_is_alive_after_fork
(
self
):
# Try hard to trigger #18418: is_alive() could sometimes be True on
# threads that vanished after a fork.
old_interval
=
sys
.
getswitchinterval
()
self
.
addCleanup
(
sys
.
setswitchinterval
,
old_interval
)
# Make the bug more likely to manifest.
sys
.
setswitchinterval
(
1e-6
)
for
i
in
range
(
20
):
t
=
threading
.
Thread
(
target
=
lambda
:
None
)
t
.
start
()
self
.
addCleanup
(
t
.
join
)
pid
=
os
.
fork
()
if
pid
==
0
:
os
.
_exit
(
1
if
t
.
is_alive
()
else
0
)
else
:
pid
,
status
=
os
.
waitpid
(
pid
,
0
)
self
.
assertEqual
(
0
,
status
)
class
ThreadJoinOnShutdown
(
BaseTestCase
):
...
...
Lib/threading.py
Dosyayı görüntüle @
9939cc89
...
...
@@ -935,7 +935,7 @@ def _after_fork():
new_active
=
{}
current
=
current_thread
()
with
_active_limbo_lock
:
for
thread
in
_
active
.
values
():
for
thread
in
_
enumerate
():
# Any lock/condition variable may be currently locked or in an
# invalid state, so we reinitialize them.
thread
.
_reset_internal_locks
()
...
...
Misc/ACKS
Dosyayı görüntüle @
9939cc89
...
...
@@ -279,6 +279,7 @@ Ben Darnell
Kushal Das
Jonathan Dasteel
Pierre-Yves David
A. Jesse Jiryu Davis
John DeGood
Ned Deily
Vincent Delft
...
...
Misc/NEWS
Dosyayı görüntüle @
9939cc89
...
...
@@ -66,6 +66,9 @@ Core and Builtins
Library
-------
- Issue #18418: After fork(), reinit all threads states, not only active ones.
Patch by A. Jesse Jiryu Davis.
- Issue #16611: http.cookie now correctly parses the '
secure
' and '
httponly
'
cookie flags.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment