提交 9bf73b64 编写于 作者: 陶建辉(Jeff)'s avatar 陶建辉(Jeff)

minor changes on debug info

上级 cb0fcf10
...@@ -36,7 +36,7 @@ void * tscTmr; ...@@ -36,7 +36,7 @@ void * tscTmr;
void * tscQhandle; void * tscQhandle;
void * tscCheckDiskUsageTmr; void * tscCheckDiskUsageTmr;
int tsInsertHeadSize; int tsInsertHeadSize;
int tscRefId; int tscRefId = -1;
int tscNumOfThreads; int tscNumOfThreads;
......
...@@ -82,13 +82,13 @@ int taosOpenRef(int max, void (*fp)(void *)) ...@@ -82,13 +82,13 @@ int taosOpenRef(int max, void (*fp)(void *))
for (i = 0; i < TSDB_REF_OBJECTS; ++i) { for (i = 0; i < TSDB_REF_OBJECTS; ++i) {
tsNextId = (tsNextId + 1) % TSDB_REF_OBJECTS; tsNextId = (tsNextId + 1) % TSDB_REF_OBJECTS;
if (tsNextId == 0) tsNextId = 1; // dont use 0 as rsetId
if (tsRefSetList[tsNextId].state == TSDB_REF_STATE_EMPTY) break; if (tsRefSetList[tsNextId].state == TSDB_REF_STATE_EMPTY) break;
} }
if (i < TSDB_REF_OBJECTS) { if (i < TSDB_REF_OBJECTS) {
rsetId = tsNextId; rsetId = tsNextId;
pSet = tsRefSetList + rsetId; pSet = tsRefSetList + rsetId;
taosIncRsetCount(pSet);
pSet->max = max; pSet->max = max;
pSet->nodeList = nodeList; pSet->nodeList = nodeList;
pSet->lockedBy = lockedBy; pSet->lockedBy = lockedBy;
...@@ -96,6 +96,7 @@ int taosOpenRef(int max, void (*fp)(void *)) ...@@ -96,6 +96,7 @@ int taosOpenRef(int max, void (*fp)(void *))
pSet->rid = 1; pSet->rid = 1;
pSet->rsetId = rsetId; pSet->rsetId = rsetId;
pSet->state = TSDB_REF_STATE_ACTIVE; pSet->state = TSDB_REF_STATE_ACTIVE;
taosIncRsetCount(pSet);
tsRefSetNum++; tsRefSetNum++;
uTrace("rsetId:%d is opened, max:%d, fp:%p refSetNum:%d", rsetId, max, fp, tsRefSetNum); uTrace("rsetId:%d is opened, max:%d, fp:%p refSetNum:%d", rsetId, max, fp, tsRefSetNum);
...@@ -469,12 +470,12 @@ static void taosInitRefModule(void) { ...@@ -469,12 +470,12 @@ static void taosInitRefModule(void) {
static void taosIncRsetCount(SRefSet *pSet) { static void taosIncRsetCount(SRefSet *pSet) {
atomic_add_fetch_32(&pSet->count, 1); atomic_add_fetch_32(&pSet->count, 1);
uTrace("rsetId:%d inc count:%d", pSet->rsetId, pSet->count); // uTrace("rsetId:%d inc count:%d", pSet->rsetId, count);
} }
static void taosDecRsetCount(SRefSet *pSet) { static void taosDecRsetCount(SRefSet *pSet) {
int32_t count = atomic_sub_fetch_32(&pSet->count, 1); int32_t count = atomic_sub_fetch_32(&pSet->count, 1);
uTrace("rsetId:%d dec count:%d", pSet->rsetId, pSet->count); // uTrace("rsetId:%d dec count:%d", pSet->rsetId, count);
if (count > 0) return; if (count > 0) return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册