diff options
author | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-30 21:02:52 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@haypocalc.com> | 2011-05-30 21:02:52 (GMT) |
commit | 2a12974bca2433eea0131d904a423ed8234dcf7a (patch) | |
tree | e238e53c319beb8f913e3411fa91a98504d1743d /Doc/library/threading.rst | |
parent | d976098e3bb53b9c52d55a303e1389a102ed8bae (diff) | |
download | cpython-2a12974bca2433eea0131d904a423ed8234dcf7a.zip cpython-2a12974bca2433eea0131d904a423ed8234dcf7a.tar.gz cpython-2a12974bca2433eea0131d904a423ed8234dcf7a.tar.bz2 |
Close #12028: Make threading._get_ident() public, rename it to
threading.get_ident() and document it. This function was used by
_thread.get_ident().
Diffstat (limited to 'Doc/library/threading.rst')
-rw-r--r-- | Doc/library/threading.rst | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/Doc/library/threading.rst b/Doc/library/threading.rst index df47045..504a2fb 100644 --- a/Doc/library/threading.rst +++ b/Doc/library/threading.rst @@ -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() |