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
cafb7107
Kaydet (Commit)
cafb7107
authored
Şub 02, 2008
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix a conversion mistake that caused test_queue to fail intermittently.
üst
ee29c3f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
test_queue.py
Lib/test/test_queue.py
+4
-4
No files found.
Lib/test/test_queue.py
Dosyayı görüntüle @
cafb7107
...
@@ -138,13 +138,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
...
@@ -138,13 +138,13 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
def
worker
(
self
,
q
):
def
worker
(
self
,
q
):
while
True
:
while
True
:
self
.
x
=
q
.
get
()
x
=
q
.
get
()
if
self
.
x
is
None
:
if
x
is
None
:
q
.
task_done
()
q
.
task_done
()
return
return
self
.
cumlock
.
acquire
()
self
.
cumlock
.
acquire
()
try
:
try
:
self
.
cum
+=
self
.
x
self
.
cum
+=
x
finally
:
finally
:
self
.
cumlock
.
release
()
self
.
cumlock
.
release
()
q
.
task_done
()
q
.
task_done
()
...
@@ -157,7 +157,7 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
...
@@ -157,7 +157,7 @@ class BaseQueueTest(unittest.TestCase, BlockingTestMixin):
q
.
put
(
i
)
q
.
put
(
i
)
q
.
join
()
q
.
join
()
self
.
assertEquals
(
self
.
cum
,
sum
(
range
(
100
)),
self
.
assertEquals
(
self
.
cum
,
sum
(
range
(
100
)),
"q.join() did not block until all tasks were done"
)
"q.join() did not block until all tasks were done"
)
for
i
in
(
0
,
1
):
for
i
in
(
0
,
1
):
q
.
put
(
None
)
# instruct the threads to close
q
.
put
(
None
)
# instruct the threads to close
q
.
join
()
# verify that you can join twice
q
.
join
()
# verify that you can join twice
...
...
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