提交 100db8ff 编写于 作者: sangshuduo's avatar sangshuduo

[TD-2210] <fix>: use LWP pid. fix windows compile issue.

上级 89c74b8a
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include <sys/syscall.h>
#define _DEFAULT_SOURCE #define _DEFAULT_SOURCE
#include "os.h" #include "os.h"
......
...@@ -181,8 +181,8 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) { ...@@ -181,8 +181,8 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) {
return; return;
} }
pThreadObj->stop = true; pThreadObj->stop = true;
if (taosComparePthread(thread, taosGetSelfPthreadId())) { if (taosComparePthread(thread, pthread_self())) {
pthread_detach(taosGetSelfPthreadId()); pthread_detach(pthread_self());
return; return;
} }
pthread_join(thread, NULL); pthread_join(thread, NULL);
...@@ -207,8 +207,8 @@ void taosStopTcpServer(void *handle) { ...@@ -207,8 +207,8 @@ void taosStopTcpServer(void *handle) {
#endif #endif
} }
if (taosCheckPthreadValid(pServerObj->thread)) { if (taosCheckPthreadValid(pServerObj->thread)) {
if (taosComparePthread(pServerObj->thread, taosGetSelfPthreadId())) { if (taosComparePthread(pServerObj->thread, pthread_self())) {
pthread_detach(taosGetSelfPthreadId()); pthread_detach(pthread_self());
} else { } else {
pthread_join(pServerObj->thread, NULL); pthread_join(pServerObj->thread, NULL);
} }
......
...@@ -327,8 +327,8 @@ static void syncStopPoolThread(SThreadObj *pThread) { ...@@ -327,8 +327,8 @@ static void syncStopPoolThread(SThreadObj *pThread) {
return; return;
} }
pThread->stop = true; pThread->stop = true;
if (taosComparePthread(thread, taosGetSelfPthreadId())) { if (taosComparePthread(thread, pthread_self())) {
pthread_detach(taosGetSelfPthreadId()); pthread_detach(pthread_self());
return; return;
} }
pthread_join(thread, NULL); pthread_join(thread, NULL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册