Skip to content

Commit

Permalink
qmp: fix thread termination issue
Browse files Browse the repository at this point in the history
- the qmp reader_thread should be joined at qmp destructor
or terminate called without an active exception error will happen.

Signed-off-by: Mahmoud Kamel <quic_mkamel@quicinc.com>
  • Loading branch information
Mahmoud Kamel committed Oct 30, 2024
1 parent 13abecb commit 445c93a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qemu-components/qmp/include/qmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@ class qmp : public sc_core::sc_module
}
}
}

~qmp()
{
if (reader_thread.joinable()) {
reader_thread.join();
}
}
};

extern "C" void module_register();
Expand Down

0 comments on commit 445c93a

Please sign in to comment.