Merged revisions 65824 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r65824 | benjamin.peterson | 2008-08-18 13:01:43 -0500 (Mon, 18 Aug 2008) | 1 line

  change a few uses of the threading APIs
........
This commit is contained in:
Benjamin Peterson 2008-08-18 18:09:21 +00:00
parent c16a7f3684
commit 7275370770
6 changed files with 16 additions and 16 deletions

View file

@ -207,7 +207,7 @@ class Server(object):
Handle requests from the proxies in a particular process/thread
'''
util.debug('starting server thread to service %r',
threading.current_thread().get_name())
threading.current_thread().name)
recv = conn.recv
send = conn.send
@ -257,7 +257,7 @@ class Server(object):
except EOFError:
util.debug('got EOF -- exiting thread serving %r',
threading.current_thread().get_name())
threading.current_thread().name)
sys.exit(0)
except Exception:
@ -270,7 +270,7 @@ class Server(object):
send(('#UNSERIALIZABLE', repr(msg)))
except Exception as e:
util.info('exception in thread serving %r',
threading.current_thread().get_name())
threading.current_thread().name)
util.info(' ... message was %r', msg)
util.info(' ... exception was %r', e)
conn.close()
@ -392,7 +392,7 @@ class Server(object):
'''
Spawn a new thread to serve this connection
'''
threading.current_thread().set_name(name)
threading.current_thread().name = name
c.send(('#RETURN', None))
self.serve_client(c)
@ -706,8 +706,8 @@ class BaseProxy(object):
def _connect(self):
util.debug('making connection to manager')
name = current_process().get_name()
if threading.current_thread().get_name() != 'MainThread':
name += '|' + threading.current_thread().get_name()
if threading.current_thread().name != 'MainThread':
name += '|' + threading.current_thread().name
conn = self._Client(self._token.address, authkey=self._authkey)
dispatch(conn, None, 'accept_connection', (name,))
self._tls.connection = conn
@ -720,7 +720,7 @@ class BaseProxy(object):
conn = self._tls.connection
except AttributeError:
util.debug('thread %r does not own a connection',
threading.current_thread().get_name())
threading.current_thread().name)
self._connect()
conn = self._tls.connection
@ -781,7 +781,7 @@ class BaseProxy(object):
# the process owns no more references to objects for this manager
if not idset and hasattr(tls, 'connection'):
util.debug('thread %r has no more proxies so closing conn',
threading.current_thread().get_name())
threading.current_thread().name)
tls.connection.close()
del tls.connection