client: ensure worker is joined on close()

This commit is contained in:
Michael Davidsaver
2020-04-04 06:46:11 -07:00
parent 9971b2ceec
commit d852758b7b
3 changed files with 16 additions and 1 deletions
+10
View File
@@ -99,6 +99,11 @@ struct evbase::Pvt : public epicsThreadRunable
}
virtual ~Pvt() {
join();
}
void join()
{
if(event_base_loopexit(base.get(), nullptr))
log_crit_printf(logerr, "evbase error while interrupting loop for %p\n", base.get());
worker.exitWait();
@@ -189,6 +194,11 @@ evbase::evbase(const std::string &name, unsigned prio)
evbase::~evbase() {}
void evbase::join()
{
pvt->join();
}
void evbase::sync()
{
call([](){});