'Close and remove all resources in the pool (also those in use).
Used to close resources from parent processes after fork
(e.g. sockets/connections).'

def force_close_all(self):

    if self._closed:
        return
    self._closed = True
    dirty = self._dirty
    resource = self._resource
    while 1:
        try:
            dres = dirty.pop()
        except KeyError:
            break
        try:
            self.collect_resource(dres)
        except AttributeError:
            pass
    while 1:
        try:
            res = resource.queue.pop()
        except IndexError:
            break
        try:
            self.collect_resource(res)
        except AttributeError:
            pass
