diff --git a/src/kit/taosdemo/taosdemo.c b/src/kit/taosdemo/taosdemo.c index 3e6867cbc57f0af9958afb66e27ffafebe89609d..b8aada820ace893a9ee50082d94f76964d905219 100644 --- a/src/kit/taosdemo/taosdemo.c +++ b/src/kit/taosdemo/taosdemo.c @@ -4536,7 +4536,7 @@ void *superQueryProcess(void *sarg) { } selectAndGetResult(winfo->taos, g_queryInfo.superQueryInfo.sql[i], tmpFile); int64_t t2 = taosGetTimestampUs(); - printf("=[taosc] thread[%"PRId64"] complete one sql, Spent %f s\n", taosGetSelfPthreadId(), (t2 - t1)/1000000.0); + printf("=[taosc] thread[%"PRId64"] complete one sql, Spent %f s\n", taosGetSelfPthreadId(), (t2 - t1)/1000000.0); } else { #ifdef TD_LOWA_CURL int64_t t1 = taosGetTimestampUs(); diff --git a/src/os/src/detail/osSemphone.c b/src/os/src/detail/osSemphone.c index ec02c65fd645002aaf42243e864584c747b8501a..2bf2f2448752bf468497fc48a8871c5f0120b9ab 100644 --- a/src/os/src/detail/osSemphone.c +++ b/src/os/src/detail/osSemphone.c @@ -13,8 +13,6 @@ * along with this program. If not, see . */ -#include - #define _DEFAULT_SOURCE #include "os.h" diff --git a/src/rpc/src/rpcTcp.c b/src/rpc/src/rpcTcp.c index 73177f90e8ee30f3435c0ce011b699f441f79964..3162ab2e4cbabc2a1ce9ed863589e3be0e92f75f 100644 --- a/src/rpc/src/rpcTcp.c +++ b/src/rpc/src/rpcTcp.c @@ -181,8 +181,8 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) { return; } pThreadObj->stop = true; - if (taosComparePthread(thread, taosGetSelfPthreadId())) { - pthread_detach(taosGetSelfPthreadId()); + if (taosComparePthread(thread, pthread_self())) { + pthread_detach(pthread_self()); return; } pthread_join(thread, NULL); @@ -207,8 +207,8 @@ void taosStopTcpServer(void *handle) { #endif } if (taosCheckPthreadValid(pServerObj->thread)) { - if (taosComparePthread(pServerObj->thread, taosGetSelfPthreadId())) { - pthread_detach(taosGetSelfPthreadId()); + if (taosComparePthread(pServerObj->thread, pthread_self())) { + pthread_detach(pthread_self()); } else { pthread_join(pServerObj->thread, NULL); } diff --git a/src/sync/src/syncTcp.c b/src/sync/src/syncTcp.c index bef558f41290a9d55569eff99c6931f2b8f37f73..3ad9e9bba01eb861c48fa121b154af3e7838dda0 100644 --- a/src/sync/src/syncTcp.c +++ b/src/sync/src/syncTcp.c @@ -327,8 +327,8 @@ static void syncStopPoolThread(SThreadObj *pThread) { return; } pThread->stop = true; - if (taosComparePthread(thread, taosGetSelfPthreadId())) { - pthread_detach(taosGetSelfPthreadId()); + if (taosComparePthread(thread, pthread_self())) { + pthread_detach(pthread_self()); return; } pthread_join(thread, NULL);