Guest
Public paste!

bitplane

By: a guest | Feb 9th, 2010 | Syntax: Python | Size: 0.23 KB | Hits: 11 | Expires: Never
Copy text to clipboard
  1.  
  2. def synchronized(f):
  3.     def blockingFunction(self, *args, **kwargs):
  4.         self.lock.acquire()
  5.         try:
  6.             return f(self, *args, **kwargs)
  7.         finally:
  8.             self.lock.release()
  9.     return blockingFunction