[issue2871] store thread.get_ident() thread identifier inside threading.Thread objects

Antoine Pitrou report at bugs.python.org
Sun May 25 00:21:55 CEST 2008


Antoine Pitrou <pitrou at free.fr> added the comment:

Well, it's true that get_ident() will always give you a reliable number
while currentThread() can play dirty games on you at shutdown. The thing
is the Thread object is dereferenced before the OS thread actually
terminates, so it may be that a Python callback is called by some C code
in those last moments and gets the wrong answer from currentThread()
(because currentThread() returns a new dummy thread when it can't find a
Thread object corresponding to the get_ident() value).

So finally your request sounds quite reasonable :-)

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2871>
__________________________________


More information about the Python-bugs-list mailing list