Skip to content

Commit 19b35f9

Browse files
fyin1lijinxia
authored andcommitted
acrn-dm: wait for monitor thread canceling finish
When thread_cancel() is called to exit pthread, we can't know when the thread exit done unless pthread_join() is used to wait for thread exit. Tracked-On: #1868 Signed-off-by: Yin Fengwei <fengwei.yin@intel.com> Acked-by: Anthony Xu <anthony.xu@intel.com>
1 parent 02a89dd commit 19b35f9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

devicemodel/core/monitor.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,10 @@ static void start_intr_storm_monitor(struct vmctx *ctx)
183183
static void stop_intr_storm_monitor(void)
184184
{
185185
if (intr_storm_monitor_pid) {
186+
void *ret;
187+
186188
pthread_cancel(intr_storm_monitor_pid);
189+
pthread_join(intr_storm_monitor_pid, &ret);
187190
intr_storm_monitor_pid = 0;
188191
}
189192
}

0 commit comments

Comments
 (0)