Browse Source

shutdown sync thread

LPA-1
Volker Birk 7 years ago
parent
commit
546c6a89f0
  1. 5
      Adapter.cc
  2. 14
      Adapter.hh

5
Adapter.cc

@ -78,6 +78,11 @@ namespace pEp {
return _session;
}
void Adapter::shutdown()
{
_inject_sync_event(nullptr, nullptr);
}
int Adapter::_inject_sync_event(SYNC_EVENT ev, void *management)
{
if (is_sync_thread(session())) {

14
Adapter.hh

@ -24,13 +24,9 @@ namespace pEp {
init,
release
};
static PEP_SESSION session(session_action action = init);
static ::utility::locked_queue< SYNC_EVENT >& queue()
{
static ::utility::locked_queue< SYNC_EVENT > q;
return q;
}
void shutdown();
protected:
static int _inject_sync_event(SYNC_EVENT ev, void *management);
@ -38,6 +34,12 @@ namespace pEp {
static void sync_thread(void *obj);
private:
static ::utility::locked_queue< SYNC_EVENT >& queue()
{
static ::utility::locked_queue< SYNC_EVENT > q;
return q;
}
static std::mutex& mtx()
{
static std::mutex m;

Loading…
Cancel
Save