mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
Close #12028: Make threading._get_ident() public, rename it to
threading.get_ident() and document it. This function was used by _thread.get_ident().
This commit is contained in:
parent
d976098e3b
commit
2a12974bca
12 changed files with 50 additions and 39 deletions
|
@ -190,18 +190,17 @@ def test_main():
|
|||
idents = []
|
||||
|
||||
def callback():
|
||||
idents.append(_thread.get_ident())
|
||||
idents.append(threading.get_ident())
|
||||
|
||||
_testcapi._test_thread_state(callback)
|
||||
a = b = callback
|
||||
time.sleep(1)
|
||||
# Check our main thread is in the list exactly 3 times.
|
||||
if idents.count(_thread.get_ident()) != 3:
|
||||
if idents.count(threading.get_ident()) != 3:
|
||||
raise support.TestFailed(
|
||||
"Couldn't find main thread correctly in the list")
|
||||
|
||||
if threading:
|
||||
import _thread
|
||||
import time
|
||||
TestThreadState()
|
||||
t = threading.Thread(target=TestThreadState)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue