Changeset 155 for etherws


Ignore:
Timestamp:
05/18/12 22:24:08 (13 years ago)
Author:
atzm
Message:
  • with lock
File:
1 edited

Legend:

Unmodified
Added
Removed
  • etherws/trunk/etherws.py

    r151 r155  
    7878            sys.stderr.write('%s: %s\n' % (caller.__class__.__name__, 
    7979                                           message.encode('hex'))) 
    80         try: 
    81             self._write_lock.acquire() 
    82  
     80        with self._write_lock: 
    8381            clients = self._clients[:] 
    8482 
     
    8987            for c in clients: 
    9088                c.write_message(message, True) 
    91  
    92         finally: 
    93             self._write_lock.release() 
    9489 
    9590    def __call__(self, fd, events): 
Note: See TracChangeset for help on using the changeset viewer.