def horcmgr_synchronized(func):
 @functools.wraps(func)
 def wrap(self, *args, **kwargs):
  'Synchronize CCI operations per CCI instance.'
  @coordination.synchronized(self.lock[args[0]])
  def func_locked(*_args, **_kwargs):
   'Execute the wrapped function in a synchronized section.'
   return func(*_args, **_kwargs)
  return func_locked(self, *args, **kwargs)
 return wrap

def horcmgr_synchronized ( func ) : @ functools . wraps ( func ) def wrap ( self , * args , ** kwargs ) : @ coordination . synchronized ( self . lock [ args [ 0 ] ] ) def func_locked ( * _args , ** _kwargs ) : return func ( * _args , ** _kwargs ) return func_locked ( self , * args , ** kwargs ) return wrap
synchronize cci operations per cci instance .