minor changes
This commit is contained in:
parent
9605658fab
commit
cb0fcf10d5
|
@ -221,8 +221,7 @@ static void rpcFree(void *p) {
|
||||||
free(p);
|
free(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rpcInit(void) {
|
void rpcInit(void) {
|
||||||
|
|
||||||
tsProgressTimer = tsRpcTimer/2;
|
tsProgressTimer = tsRpcTimer/2;
|
||||||
tsRpcMaxRetry = tsRpcMaxTime * 1000/tsProgressTimer;
|
tsRpcMaxRetry = tsRpcMaxTime * 1000/tsProgressTimer;
|
||||||
tsRpcHeadSize = RPC_MSG_OVERHEAD;
|
tsRpcHeadSize = RPC_MSG_OVERHEAD;
|
||||||
|
@ -231,6 +230,11 @@ static void rpcInit(void) {
|
||||||
tsRpcRefId = taosOpenRef(200, rpcFree);
|
tsRpcRefId = taosOpenRef(200, rpcFree);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void rpcCleanup(void) {
|
||||||
|
taosCloseRef(tsRpcRefId);
|
||||||
|
tsRpcRefId = -1;
|
||||||
|
}
|
||||||
|
|
||||||
void *rpcOpen(const SRpcInit *pInit) {
|
void *rpcOpen(const SRpcInit *pInit) {
|
||||||
SRpcInfo *pRpc;
|
SRpcInfo *pRpc;
|
||||||
|
|
||||||
|
@ -1621,11 +1625,7 @@ static void rpcDecRef(SRpcInfo *pRpc)
|
||||||
tDebug("%s rpc resources are released", pRpc->label);
|
tDebug("%s rpc resources are released", pRpc->label);
|
||||||
taosTFree(pRpc);
|
taosTFree(pRpc);
|
||||||
|
|
||||||
int count = atomic_sub_fetch_32(&tsRpcNum, 1);
|
atomic_sub_fetch_32(&tsRpcNum, 1);
|
||||||
if (count == 0) {
|
|
||||||
// taosCloseRef(tsRpcRefId);
|
|
||||||
// tsRpcInit = PTHREAD_ONCE_INIT; // windows compliling error
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue