@classmethod
def instance(cls):
    """Return a global IOLoop instance."""
    if cls._instance is None:
        cls._lock.acquire()
        try:
            if cls._instance is None:
                cls._instance = cls()
        finally:
            cls._lock.release()
    return cls._instance
