diff -NurpP python2.6_orig/threading.py python2.6/threading.py --- python2.6_orig/threading.py 2010-09-15 21:08:23.000000000 +0400 +++ python2.6/threading.py 2011-05-03 12:00:55.594854003 +0400 @@ -9,6 +9,7 @@ except ImportError: raise import warnings +import itertools from functools import wraps from time import time as _time, sleep as _sleep @@ -397,11 +398,10 @@ class _Event(_Verbose): self.__cond.release() # Helper to generate new thread names -_counter = 0 +_counter = itertools.count() def _newname(template="Thread-%d"): global _counter - _counter = _counter + 1 - return template % _counter + return template % _counter.next() # Active thread administration _active_limbo_lock = _allocate_lock()