refactor(cluster): make sdb ver atomic

This commit is contained in:
Shengliang Guan 2022-04-26 17:45:37 +08:00
parent 1f2b8ae1df
commit cfe7abce4b
1 changed files with 1 additions and 4 deletions

View File

@ -162,7 +162,4 @@ static int32_t sdbCreateDir(SSdb *pSdb) {
return 0;
}
int64_t sdbUpdateVer(SSdb *pSdb, int32_t val) {
pSdb->curVer += val;
return pSdb->curVer;
}
int64_t sdbUpdateVer(SSdb *pSdb, int32_t val) { return atomic_add_fetch_64(&pSdb->curVer, val); }