'Tidy up any resources used by the handler.
This version removes the handler from an internal map of handlers,
_handlers, which is used for handler lookup by name. Subclasses
should ensure that this gets called from overridden close()
methods.'

def close(self):

    _acquireLock()
    try:
        if (self._name and (self._name in _handlers)):
            del _handlers[self._name]
    finally:
        _releaseLock()
