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
ef660e8e
Kaydet (Commit)
ef660e8e
authored
Mar 31, 2009
tarafından
Georg Brandl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#1674032: return value of flag from Event.wait(). OKed by Guido.
üst
1d7d5325
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
threading.rst
Doc/library/threading.rst
+9
-3
test_threading.py
Lib/test/test_threading.py
+2
-1
threading.py
Lib/threading.py
+1
-0
No files found.
Doc/library/threading.rst
Dosyayı görüntüle @
ef660e8e
...
...
@@ -696,14 +696,20 @@ An event object manages an internal flag that can be set to true with the
.. method:: Event.wait([timeout])
Block until the internal flag is true. If the internal flag is true on entry,
return immediately. Otherwise, block until another thread calls :meth:`set`
to
set the flag to true, or until the optional timeout occurs.
Block until the internal flag is true.
If the internal flag is true on entry,
return immediately. Otherwise, block until another thread calls :meth:`set`
to
set the flag to true, or until the optional timeout occurs.
When the timeout argument is present and not ``None``, it should be a floating
point number specifying a timeout for the operation in seconds (or fractions
thereof).
This method returns the internal flag on exit, so it will always return
``True`` except if a timeout is given and the operation times out.
.. versionchanged:: 2.7
Previously, the method always returned ``None``.
.. _timer-objects:
...
...
Lib/test/test_threading.py
Dosyayı görüntüle @
ef660e8e
...
...
@@ -186,7 +186,8 @@ class ThreadTests(unittest.TestCase):
# Now raise an exception in the worker thread.
if
verbose
:
print
" waiting for worker thread to get started"
worker_started
.
wait
()
ret
=
worker_started
.
wait
()
self
.
assertTrue
(
ret
)
if
verbose
:
print
" verifying worker hasn't exited"
self
.
assert_
(
not
t
.
finished
)
...
...
Lib/threading.py
Dosyayı görüntüle @
ef660e8e
...
...
@@ -391,6 +391,7 @@ class _Event(_Verbose):
try
:
if
not
self
.
__flag
:
self
.
__cond
.
wait
(
timeout
)
return
self
.
__flag
finally
:
self
.
__cond
.
release
()
...
...
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