diff options
author | Benjamin Peterson <benjamin@python.org> | 2009-03-31 21:40:18 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2009-03-31 21:40:18 (GMT) |
commit | 61611f84c91b3cd6d70e8f554efcef243f3413d1 (patch) | |
tree | 89106dfe4a381a55b579a0149b72974a6314f9cf /Lib/threading.py | |
parent | a6f278cfa237ae56bb24468baeed335540bf3b32 (diff) | |
download | cpython-61611f84c91b3cd6d70e8f554efcef243f3413d1.zip cpython-61611f84c91b3cd6d70e8f554efcef243f3413d1.tar.gz cpython-61611f84c91b3cd6d70e8f554efcef243f3413d1.tar.bz2 |
Merged revisions 70897 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70897 | benjamin.peterson | 2009-03-31 16:34:42 -0500 (Tue, 31 Mar 2009) | 1 line
fix Thread.ident when it is the main thread or a dummy thread #5632
........
Diffstat (limited to 'Lib/threading.py')
-rw-r--r-- | Lib/threading.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/threading.py b/Lib/threading.py index a776c66..c1791d7 100644 --- a/Lib/threading.py +++ b/Lib/threading.py @@ -500,9 +500,12 @@ class Thread(_Verbose): return raise + def _set_ident(self): + self.__ident = _get_ident() + def __bootstrap_inner(self): try: - self.__ident = _get_ident() + self._set_ident() self.__started.set() _active_limbo_lock.acquire() _active[self.__ident] = self @@ -734,6 +737,7 @@ class _MainThread(Thread): def __init__(self): Thread.__init__(self, name="MainThread") self._Thread__started.set() + self._set_ident() _active_limbo_lock.acquire() _active[_get_ident()] = self _active_limbo_lock.release() @@ -780,6 +784,7 @@ class _DummyThread(Thread): del self._Thread__block self._Thread__started.set() + self._set_ident() _active_limbo_lock.acquire() _active[_get_ident()] = self _active_limbo_lock.release() |