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
a87501fd
Kaydet (Commit)
a87501fd
authored
Şub 05, 2015
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: BaseEventLoop: rename _owner to _thread_id
üst
05784a70
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
base_events.py
Lib/asyncio/base_events.py
+6
-6
No files found.
Lib/asyncio/base_events.py
Dosyayı görüntüle @
a87501fd
...
...
@@ -188,7 +188,7 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_internal_fds
=
0
# Identifier of the thread running the event loop, or None if the
# event loop is not running
self
.
_
owner
=
None
self
.
_
thread_id
=
None
self
.
_clock_resolution
=
time
.
get_clock_info
(
'monotonic'
)
.
resolution
self
.
_exception_handler
=
None
self
.
_debug
=
(
not
sys
.
flags
.
ignore_environment
...
...
@@ -269,7 +269,7 @@ class BaseEventLoop(events.AbstractEventLoop):
self
.
_check_closed
()
if
self
.
is_running
():
raise
RuntimeError
(
'Event loop is running.'
)
self
.
_
owner
=
threading
.
get_ident
()
self
.
_
thread_id
=
threading
.
get_ident
()
try
:
while
True
:
try
:
...
...
@@ -277,7 +277,7 @@ class BaseEventLoop(events.AbstractEventLoop):
except
_StopError
:
break
finally
:
self
.
_
owner
=
None
self
.
_
thread_id
=
None
def
run_until_complete
(
self
,
future
):
"""Run until the Future is done.
...
...
@@ -362,7 +362,7 @@ class BaseEventLoop(events.AbstractEventLoop):
def
is_running
(
self
):
"""Returns True if the event loop is running."""
return
(
self
.
_
owner
is
not
None
)
return
(
self
.
_
thread_id
is
not
None
)
def
time
(
self
):
"""Return the time according to the event loop's clock.
...
...
@@ -449,10 +449,10 @@ class BaseEventLoop(events.AbstractEventLoop):
Should only be called when (self._debug == True). The caller is
responsible for checking this condition for performance reasons.
"""
if
self
.
_
owner
is
None
:
if
self
.
_
thread_id
is
None
:
return
thread_id
=
threading
.
get_ident
()
if
thread_id
!=
self
.
_
owner
:
if
thread_id
!=
self
.
_
thread_id
:
raise
RuntimeError
(
"Non-thread-safe operation invoked on an event loop other "
"than the current one"
)
...
...
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