#NEWLINE# @ staticmethod #NEWLINE# def add_allocator( allocator ) : #NEWLINE# #INDENT# '\n        Add an allocator to the list of resource allocators.\n\n        allocator: ResourceAllocator\n            The allocator to be added.\n        ' #NEWLINE# ram = ResourceAllocationManager . _get_instance ( ) #NEWLINE# with ResourceAllocationManager . _lock : #NEWLINE# #INDENT# name = allocator . name #NEWLINE# for alloc in ram . _allocators : #NEWLINE# #INDENT# if ( alloc . name == name ) : #NEWLINE# #INDENT# raise RuntimeError ( ( 'allocator named %r already exists' % name ) ) #NEWLINE# #UNINDENT# #UNINDENT# ram . _allocators . append ( allocator )