fix: get a thread id for printing with taosGetPthreadId

This commit is contained in:
Benguang Zhao 2022-10-19 11:26:23 +08:00
parent 00a066443f
commit f23018e38a
2 changed files with 5 additions and 5 deletions

View File

@ -380,7 +380,7 @@ int32_t dmRunProc(SProc *proc) {
dError("node:%s, failed to create pthread since %s", proc->name, terrstr()); dError("node:%s, failed to create pthread since %s", proc->name, terrstr());
return -1; return -1;
} }
dDebug("node:%s, thread:%p is created to consume pqueue", proc->name, (void *)proc->pthread); dDebug("node:%s, thread:%" PRId64 " is created to consume pqueue", proc->name, taosGetPthreadId(proc->pthread));
} }
if (proc->ptype & DND_PROC_CHILD) { if (proc->ptype & DND_PROC_CHILD) {
@ -389,7 +389,7 @@ int32_t dmRunProc(SProc *proc) {
dError("node:%s, failed to create cthread since %s", proc->name, terrstr()); dError("node:%s, failed to create cthread since %s", proc->name, terrstr());
return -1; return -1;
} }
dDebug("node:%s, thread:%p is created to consume cqueue", proc->name, (void *)proc->cthread); dDebug("node:%s, thread:%" PRId64 " is created to consume cqueue", proc->name, taosGetPthreadId(proc->cthread));
} }
taosThreadAttrDestroy(&thAttr); taosThreadAttrDestroy(&thAttr);
@ -399,14 +399,14 @@ int32_t dmRunProc(SProc *proc) {
void dmStopProc(SProc *proc) { void dmStopProc(SProc *proc) {
proc->stop = true; proc->stop = true;
if (taosCheckPthreadValid(proc->pthread)) { if (taosCheckPthreadValid(proc->pthread)) {
dDebug("node:%s, start to join pthread:%p", proc->name, (void *)proc->pthread); dDebug("node:%s, start to join pthread:%" PRId64 "", proc->name, taosGetPthreadId(proc->pthread));
tsem_post(&proc->pqueue->sem); tsem_post(&proc->pqueue->sem);
taosThreadJoin(proc->pthread, NULL); taosThreadJoin(proc->pthread, NULL);
taosThreadClear(&proc->pthread); taosThreadClear(&proc->pthread);
} }
if (taosCheckPthreadValid(proc->cthread)) { if (taosCheckPthreadValid(proc->cthread)) {
dDebug("node:%s, start to join cthread:%p", proc->name, (void *)proc->cthread); dDebug("node:%s, start to join cthread:%" PRId64 "", proc->name, taosGetPthreadId(proc->cthread));
tsem_post(&proc->cqueue->sem); tsem_post(&proc->cqueue->sem);
taosThreadJoin(proc->cthread, NULL); taosThreadJoin(proc->cthread, NULL);
taosThreadClear(&proc->cthread); taosThreadClear(&proc->cthread);

View File

@ -455,7 +455,7 @@ static int32_t tdRsmaStopExecutor(const SSma *pSma) {
for (int32_t i = 0; i < tsNumOfVnodeRsmaThreads; ++i) { for (int32_t i = 0; i < tsNumOfVnodeRsmaThreads; ++i) {
if (taosCheckPthreadValid(pthread[i])) { if (taosCheckPthreadValid(pthread[i])) {
smaDebug("vgId:%d, start to join pthread for rsma:%p", SMA_VID(pSma), (void *)pthread[i]); smaDebug("vgId:%d, start to join pthread for rsma:%" PRId64 "", SMA_VID(pSma), taosGetPthreadId(pthread[i]));
taosThreadJoin(pthread[i], NULL); taosThreadJoin(pthread[i], NULL);
} }
} }