comparison bot.py @ 35:ebf516b2e5c9

Switched from Lock() to RLock(). Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sun, 23 Aug 2009 00:38:01 +0200
parents 57d0e66378b0
children 7e500d4064fb
comparison
equal deleted inserted replaced
34:57d0e66378b0 35:ebf516b2e5c9
424 c.used_by += 1 424 c.used_by += 1
425 self.error('===> Debug: using existing XMPP connection for "'+nickname+'", now used by '+str(c.used_by)+' bridges', debug=True) 425 self.error('===> Debug: using existing XMPP connection for "'+nickname+'", now used by '+str(c.used_by)+' bridges', debug=True)
426 return c 426 return c
427 self.error('===> Debug: opening new XMPP connection for "'+nickname+'"', debug=True) 427 self.error('===> Debug: opening new XMPP connection for "'+nickname+'"', debug=True)
428 c = xmpp.client.Client(self.bare_jid.getDomain(), debug=[]) 428 c = xmpp.client.Client(self.bare_jid.getDomain(), debug=[])
429 c.lock = threading.Lock() 429 c.lock = threading.RLock()
430 c.lock.acquire() 430 c.lock.acquire()
431 self.xmpp_connections[nickname] = c 431 self.xmpp_connections[nickname] = c
432 c.used_by = 1 432 c.used_by = 1
433 c.nickname = nickname 433 c.nickname = nickname
434 c.connect() 434 c.connect()