issue #408: use compatible method to get thread ID.

issue510
David Wilson 5 years ago
parent 3aff3e5506
commit 5b45b5851c

@ -57,6 +57,11 @@ import imp
# Absolute imports for <2.5.
select = __import__('select')
try:
import thread
except ImportError:
import threading as thread
try:
import cPickle as pickle
except ImportError:
@ -1917,7 +1922,7 @@ class Latch(object):
This disambiguates legitimate wake-ups, accidental writes to the FD,
and buggy internal FD sharing.
"""
ident = threading.currentThread().ident
ident = thread.get_ident()
return b(u'%010d-%016x-%016x' % (os.getpid(), int(id(self)), ident))
COOKIE_SIZE = len(_make_cookie(None))

Loading…
Cancel
Save