Esempio n. 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
Esempio n. 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
Esempio n. 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
Esempio n. 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