def stop(self):
        """Stop all green threads."""
        self.logger.debug('PostgresGreenlet stop')
        self._stop_event.set()
        # ask all threads to stop.
        for server in self.servers + [DDPLauncher.pgworker]:
            self.logger.debug('Stopping %s', server)
            server.stop()
        # wait for all threads to stop.
        gevent.joinall(self.threads + [DDPLauncher.pgworker])
        self.threads = []