def getInstance(): if not MysqlConn.__instance: MysqlConn.__lock.acquire() if not MysqlConn.__instance: MysqlConn.__instance = Connection.__new__(MysqlConn) MysqlConn.__instance.__DBUtilInit() MysqlConn.__lock.release() return MysqlConn.__instance