diff --git a/source/os/src/osThread.c b/source/os/src/osThread.c index 5a24e7775f..95ff06e09e 100644 --- a/source/os/src/osThread.c +++ b/source/os/src/osThread.c @@ -20,6 +20,7 @@ int32_t taosThreadCreate(TdThread *tid, const TdThreadAttr *attr, void *(*start)(void *), void *arg) { int32_t code = pthread_create(tid, attr, start, arg); if (code) { + taosThreadClear(tid); terrno = TAOS_SYSTEM_ERROR(code); return terrno; }