mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +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
|
@ -48,6 +48,17 @@ This module defines the following functions and objects:
|
|||
returned.
|
||||
|
||||
|
||||
.. function:: get_ident()
|
||||
|
||||
Return the 'thread identifier' of the current thread. This is a nonzero
|
||||
integer. Its value has no direct meaning; it is intended as a magic cookie
|
||||
to be used e.g. to index a dictionary of thread-specific data. Thread
|
||||
identifiers may be recycled when a thread exits and another thread is
|
||||
created.
|
||||
|
||||
.. versionadded:: 3.3
|
||||
|
||||
|
||||
.. function:: enumerate()
|
||||
|
||||
Return a list of all :class:`Thread` objects currently alive. The list
|
||||
|
@ -332,10 +343,10 @@ impossible to detect the termination of alien threads.
|
|||
.. attribute:: ident
|
||||
|
||||
The 'thread identifier' of this thread or ``None`` if the thread has not
|
||||
been started. This is a nonzero integer. See the
|
||||
:func:`thread.get_ident()` function. Thread identifiers may be recycled
|
||||
when a thread exits and another thread is created. The identifier is
|
||||
available even after the thread has exited.
|
||||
been started. This is a nonzero integer. See the :func:`get_ident()`
|
||||
function. Thread identifiers may be recycled when a thread exits and
|
||||
another thread is created. The identifier is available even after the
|
||||
thread has exited.
|
||||
|
||||
.. method:: is_alive()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue