@@ -935,7 +935,7 @@ class is implemented.
935
935
self .
8000
_ident = None
936
936
if _HAVE_THREAD_NATIVE_ID :
937
937
self ._native_id = None
938
- self ._handle = _ThreadHandle ()
938
+ self ._os_thread_handle = _ThreadHandle ()
939
939
self ._started = Event ()
940
940
self ._initialized = True
941
941
# Copy of sys.stderr used by self._invoke_excepthook()
@@ -950,7 +950,7 @@ def _after_fork(self, new_ident=None):
950
950
if new_ident is not None :
951
951
# This thread is alive.
952
952
self ._ident = new_ident
953
- assert self ._handle .ident == new_ident
953
+ assert self ._os_thread_handle .ident == new_ident
954
954
else :
955
955
# Otherwise, the thread is dead, Jim. _PyThread_AfterFork()
956
956
# already marked our handle done.
@@ -961,7 +961,7 @@ def __repr__(self):
961
961
status = "initial"
962
962
if self ._started .is_set ():
963
963
status = "started"
964
- if self ._handle .is_done ():
964
+ if self ._os_thread_handle .is_done ():
965
965
status = "stopped"
966
966
if self ._daemonic :
967
967
status += " daemon"
@@ -999,7 +999,7 @@ def start(self):
999
999
1000
1000
try :
1001
1001
# Start joinable thread
1002
- _start_joinable_thread (self ._bootstrap , handle = self ._handle ,
1002
+ _start_joinable_thread (self ._bootstrap , handle = self ._os_thread_handle ,
1003
1003
daemon = self .daemon )
1004
1004
except Exception :
1005
1005
with _active_limbo_lock :
@@ -1127,7 +1127,7 @@ def join(self, timeout=None):
1127
1127
if timeout is not None :
1128
1128
timeout = max (timeout , 0 )
1129
1129
1130
- self ._handle .join (timeout )
1130
+ self ._os_thread_handle .join (timeout )
1131
1131
1132
1132
@property
1133
1133
def name (self ):
@@ -1180,7 +1180,7 @@ def is_alive(self):
1180
1180
1181
1181
"""
1182
1182
assert self ._initialized , "Thread.__init__() not called"
1183
- return self ._started .is_set () and not self ._handle .is_done ()
1183
+ return self ._started .is_set () and not self ._os_thread_handle .is_done ()
1184
1184
1185
1185
@property
1186
1186
def daemon (self ):
@@ -1391,7 +1391,7 @@ def __init__(self):
1391
1391
Thread .__init__ (self , name = "MainThread" , daemon = False )
1392
1392
self ._started .set ()
1393
1393
self ._ident = _get_main_thread_ident ()
1394
- self ._handle = _make_thread_handle (self ._ident )
1394
+ self ._os_thread_handle = _make_thread_handle (self ._ident )
1395
1395
if _HAVE_THREAD_NATIVE_ID :
1396
1396
self ._set_native_id ()
1397
1397
with _active_limbo_lock :
@@ -1439,15 +1439,15 @@ def __init__(self):
1439
1439
daemon = _daemon_threads_allowed ())
1440
1440
self ._started .set ()
1441
1441
self ._set_ident ()
1442
- self ._handle = _make_thread_handle (self ._ident )
1442
+ self ._os_thread_handle = _make_thread_handle (self ._ident )
1443
1443
if _HAVE_THREAD_NATIVE_ID :
1444
1444
self ._set_native_id ()
1445
1445
with _active_limbo_lock :
1446
1446
_active [self ._ident ] = self
1447
1447
_DeleteDummyThreadOnDel (self )
1448
1448
1449
1449
def is_alive (self ):
1450
- if not self ._handle .is_done () and self ._started .is_set ():
1450
+ if not self ._os_thread_handle .is_done () and self ._started .is_set ():
1451
1451
return True
1452
1452
raise RuntimeError ("thread is not alive" )
1453
1453
@@ -1561,7 +1561,7 @@ def _shutdown():
1561
1561
# dubious, but some code does it. We can't wait for it to be marked as done
1562
1562
# normally - that won't happen until the interpreter is nearly dead. So
1563
1563
# mark it done here.
1564
- if _main_thread ._handle .is_done () and _is_main_interpreter ():
1564
+ if _main_thread ._os_thread_handle .is_done () and _is_main_interpreter ():
1565
1565
# _shutdown() was already called
1566
1566
return
1567
1567
@@ -1574,7 +1574,7 @@ def _shutdown():
1574
1574
atexit_call ()
1575
1575
1576
1576
if _is_main_interpreter ():
1577
- _main_thread ._handle ._set_done ()
1577
+ _main_thread ._os_thread_handle ._set_done ()
1578
1578
1579
1579
# Wait for all non-daemon threads to exit.
1580
1580
_thread_shutdown ()
0 commit comments