Example #1
0
 def lockedfunc(*args, **kwargs):
     """ the locked function. """
     where = getname(str(func))
     try:
         rlockmanager.acquire(where)
         res = func(*args, **kwargs)
     finally: rlockmanager.release(where)
     return res
Example #2
0
 def __getattribute__(self, attr):
     where = whichmodule(1)
     logging.debug('locking - locking on %s' % where)
     rlockmanager.acquire(object)
     res = None
     try: res = super(Locked, self).__getattribute__(attr)
     finally: rlockmanager.release(object)
     return res
Example #3
0
 def lockedfunc(*args, **kwargs):
     """ the locked function. """
     where = getname(str(func))
     try:
         rlockmanager.acquire(where)
         res = func(*args, **kwargs)
     finally:
         rlockmanager.release(where)
     return res
Example #4
0
 def __getattribute__(self, attr):
     where = whichmodule(1)
     logging.debug('locking - locking on %s' % where)
     rlockmanager.acquire(object)
     res = None
     try:
         res = super(Locked, self).__getattribute__(attr)
     finally:
         rlockmanager.release(object)
     return res