@@ -916,7 +916,7 @@ class is implemented.
916
916
self ._ident = None
917
917
if _HAVE_THREAD_NATIVE_ID :
918
918
self ._native_id = None
919
- self ._handle = _ThreadHandle ()
919
+ self ._os_thread_handle = _ThreadHandle ()
920
920
self ._started = Event ()
921
921
self ._initialized = True
922
922
# Copy of sys.stderr used by self._invoke_excepthook()
@@ -931,7 +931,7 @@ def _after_fork(self, new_ident=None):
931
931
if new_ident is not None :
932
932
# This thread is alive.
933
933
self ._ident = new_ident
934
- assert self ._handle .ident == new_ident
934
+ assert self ._os_thread_handle .ident == new_ident
935
935
else :
936
936
# Otherwise, the thread is dead, Jim. _PyThread_AfterFork()
937
937
# already marked our handle done.
@@ -942,7 +942,7 @@ def __repr__(self):
942
942
status = "initial"
943
943
if self ._started .is_set ():
944
944
status = "started"
945
- if self ._handle .is_done ():
945
+ if self ._os_thread_handle .is_done ():
946
946
status = "stopped"
947
947
if self ._daemonic :
948
948
status += " daemon"
@@ -970,7 +970,7 @@ def start(self):
970
970
_limbo [self ] = self
971
971
try :
972
972
# Start joinable thread
973
- _start_joinable_thread (self ._bootstrap , handle = self ._handle ,
973
+ _start_joinable_thread (self ._bootstrap , handle = self ._os_thread_handle ,
974
974
daemon = self .daemon )
975
975
except Exception :
976
976
with _active_limbo_lock :
@@ -1089,7 +1089,7 @@ def join(self, timeout=None):
1089
1089
if timeout is not None :
1090
1090
timeout = max (timeout , 0 )
1091
1091
1092
- self ._handle .join (timeout )
1092
+ self ._os_thread_handle .join (timeout )
1093
1093
1094
1094
@property
1095
1095
def name (self ):
@@ -1140,7 +1140,7 @@ def is_alive(self):
1140
1140
1141
1141
"""
1142
1142
assert self ._initialized , "Thread.__init__() not called"
1143
- return self ._started .is_set () and not self ._handle .is_done ()
1143
+ return self ._started .is_set () and not self ._os_thread_handle .is_done ()
1144
1144
1145
1145
@property
1146
1146
def daemon (self ):
@@ -1351,7 +1351,7 @@ def __init__(self):
1351
1351
Thread .__init__ (self , name = "MainThread" , daemon = False )
1352
1352
self ._started .set ()
1353
1353
self ._ident = _get_main_thread_ident ()
1354
- self ._handle = _make_thread_handle (self ._ident )
1354
+ self ._os_thread_handle = _make_thread_handle (self ._ident )
1355
1355
if _HAVE_THREAD_NATIVE_ID :
1356
1356
self ._set_native_id ()
1357
1357
with _active_limbo_lock :
@@ -1399,15 +1399,15 @@ def __init__(self):
1399
1399
daemon = _daemon_threads_allowed ())
1400
1400
self ._started .set ()
1401
1401
self ._set_ident ()
1402
- self ._handle = _make_thread_handle (self ._ident )
1402
+ self ._os_thread_handle = _make_thread_handle (self ._ident )
1403
1403
if _HAVE_THREAD_NATIVE_ID :
1404
1404
self ._set_native_id ()
1405
1405
with _active_limbo_lock :
1406
1406
_active [self ._ident ] = self
1407
1407
_DeleteDummyThreadOnDel (self )
1408
1408
1409
1409
def is_alive (self ):
1410
- if not self ._handle .is_done () and self ._started .is_set ():
1410
+ if not self ._os_thread_handle .is_done () and self ._started .is_set ():
1411
1411
return True
1412
1412
raise RuntimeError ("thread is not alive" )
1413
1413
@@ -1521,7 +1521,7 @@ def _shutdown():
1521
1521
# dubious, but some code does it. We can't wait for it to be marked as done
1522
1522
# normally - that won't happen until the interpreter is nearly dead. So
1523
1523
# mark it done here.
1524
- if _main_thread ._handle .is_done () and _is_main_interpreter ():
1524
+ if _main_thread ._os_thread_handle .is_done () and _is_main_interpreter ():
1525
1525
# _shutdown() was already called
1526
1526
return
1527
1527
@@ -1534,7 +1534,7 @@ def _shutdown():
1534
1534
atexit_call ()
1535
1535
1536
1536
if _is_main_interpreter ():
1537
- _main_thread ._handle ._set_done ()
1537
+ _main_thread ._os_thread_handle ._set_done ()
1538
1538
1539
1539
# Wait for all non-daemon threads to exit.
1540
1540
_thread_shutdown ()
0 commit comments