From 3dab0433448693760a0966dccfcb38f7aff77947 Mon Sep 17 00:00:00 2001 From: Conghui Date: Tue, 9 Aug 2022 12:26:11 +0800 Subject: [PATCH] dm: bugfix for iothread As the type of pthread_t is unsigned long, so the init value for it should not be '-1'. When the tid is '-1', it will continue to call pthread_kill/pthread_join. This is incorrect. Tracked-On: #7960 Signed-off-by: Conghui Reviewed-by: Zhao Yakui Acked-by: Wang, Yu1 --- devicemodel/core/iothread.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicemodel/core/iothread.c b/devicemodel/core/iothread.c index 0f56ea60d..238ecb375 100644 --- a/devicemodel/core/iothread.c +++ b/devicemodel/core/iothread.c @@ -145,7 +145,7 @@ iothread_init(void) pthread_mutex_init(&ioctx.mtx, &attr); pthread_mutexattr_destroy(&attr); - ioctx.tid = -1; + ioctx.tid = 0; ioctx.started = false; ioctx.epfd = epoll_create1(0);