def patch_cache_rr(lock_obj):
 import rr_cache
 import rr_cache_with_lock
 rr_lock1lvl = rr_cache_with_lock.create_cache1lvl(lock_obj)
 rr_lock2lvl = rr_cache_with_lock.create_cache2lvl(lock_obj)
 __patch(rr_cache, 'cache1lvl', rr_lock1lvl)
 __patch(rr_cache, 'cache2lvl', rr_lock2lvl)

def patch_cache_rr ( lock_obj ) : import rr_cache import rr_cache_with_lock rr_lock1lvl = rr_cache_with_lock . create_cache1lvl ( lock_obj ) rr_lock2lvl = rr_cache_with_lock . create_cache2lvl ( lock_obj ) __patch ( rr_cache , 'cache1lvl' , rr_lock1lvl ) __patch ( rr_cache , 'cache2lvl' , rr_lock2lvl )
patches cache mechanizm to be thread safe .