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
5fe291f8
Kaydet (Commit)
5fe291f8
authored
Eyl 06, 2008
tarafından
Antoine Pitrou
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #874900: fix behaviour of threading module after a fork.
Reviewed by Gregory P. Smith.
üst
0a608fda
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
5 deletions
+12
-5
test_threading.py
Lib/test/test_threading.py
+4
-2
threading.py
Lib/threading.py
+6
-3
NEWS
Misc/NEWS
+2
-0
No files found.
Lib/test/test_threading.py
Dosyayı görüntüle @
5fe291f8
...
@@ -347,6 +347,9 @@ class ThreadJoinOnShutdown(unittest.TestCase):
...
@@ -347,6 +347,9 @@ class ThreadJoinOnShutdown(unittest.TestCase):
def joiningfunc(mainthread):
def joiningfunc(mainthread):
mainthread.join()
mainthread.join()
print('end of thread')
print('end of thread')
# stdout is fully buffered because not a tty, we have to flush
# before exit.
sys.stdout.flush()
\n
"""
+
script
\n
"""
+
script
import
subprocess
import
subprocess
...
@@ -388,8 +391,7 @@ class ThreadJoinOnShutdown(unittest.TestCase):
...
@@ -388,8 +391,7 @@ class ThreadJoinOnShutdown(unittest.TestCase):
"""
"""
self
.
_run_and_join
(
script
)
self
.
_run_and_join
(
script
)
# XXX This test hangs!
def
test_3_join_in_forked_from_thread
(
self
):
def
Xtest_3_join_in_forked_from_thread
(
self
):
# Like the test above, but fork() was called from a worker thread
# Like the test above, but fork() was called from a worker thread
# In the forked process, the main Thread object must be marked as stopped.
# In the forked process, the main Thread object must be marked as stopped.
import
os
import
os
...
...
Lib/threading.py
Dosyayı görüntüle @
5fe291f8
...
@@ -835,16 +835,19 @@ def _after_fork():
...
@@ -835,16 +835,19 @@ def _after_fork():
new_active
=
{}
new_active
=
{}
current
=
current_thread
()
current
=
current_thread
()
with
_active_limbo_lock
:
with
_active_limbo_lock
:
for
ident
,
thread
in
_active
.
item
s
():
for
thread
in
_active
.
value
s
():
if
thread
is
current
:
if
thread
is
current
:
# There is only one active thread.
# There is only one active thread. We reset the ident to
# its new value since it can have changed.
ident
=
_get_ident
()
thread
.
_ident
=
ident
new_active
[
ident
]
=
thread
new_active
[
ident
]
=
thread
else
:
else
:
# All the others are already stopped.
# All the others are already stopped.
# We don't call _Thread__stop() because it tries to acquire
# We don't call _Thread__stop() because it tries to acquire
# thread._Thread__block which could also have been held while
# thread._Thread__block which could also have been held while
# we forked.
# we forked.
thread
.
_
Thread__
stopped
=
True
thread
.
_stopped
=
True
_limbo
.
clear
()
_limbo
.
clear
()
_active
.
clear
()
_active
.
clear
()
...
...
Misc/NEWS
Dosyayı görüntüle @
5fe291f8
...
@@ -90,6 +90,8 @@ C API
...
@@ -90,6 +90,8 @@ C API
Library
Library
-------
-------
- Issue #874900: fix behaviour of threading module after a fork.
- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
- Issue #3535: zipfile couldn't read some zip files larger than 2GB.
- Issue #3776: Deprecate the bsddb package for removal in 3.0.
- Issue #3776: Deprecate the bsddb package for removal in 3.0.
...
...
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