@staticmethod
    def GetNextID(boardname):
        ret = -1
        lockfd = BCache.Lock()
        if (lockfd < 0):
            Log.warn("BCache lock fail")
            return -1

        try:
            bh = BCache.GetBoardHeader(boardname)
            if (bh != None):
                bh.nowid += 1
                ret = bh.nowid
            else:
                Log.warn("GetNextID() fail for board %s" % boardname)
        finally:
            BCache.Unlock(lockfd)
        return ret
dataset/ETHPy150Open HenryHu/pybbs/BCache.py/BCache.GetNextID/original