From c6352281f849f406827a13fac7099976f48ae58a Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Wed, 27 Nov 2019 18:21:46 +0100 Subject: [PATCH] do not join() if on sync thread --- Adapter.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Adapter.cc b/Adapter.cc index 41c4004..536612f 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -51,10 +51,12 @@ namespace pEp { return 1; } if (ev == nullptr) { - if (_sync_thread) { - _sync_thread->join(); - delete _sync_thread; - _sync_thread = nullptr; + if (!on_sync_thread()) { + if (_sync_thread) { + _sync_thread->join(); + delete _sync_thread; + _sync_thread = nullptr; + } } q.clear(); }