From 6cdfe86402ea5d14124140bb52c5cb057aed7bd2 Mon Sep 17 00:00:00 2001 From: heck Date: Mon, 15 Feb 2021 22:07:48 +0100 Subject: [PATCH] non-local single char named vars are not that handy. --- Adapter.cc | 12 ++++++------ Adapter.hxx | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Adapter.cc b/Adapter.cc index f4a776d..47cfaae 100644 --- a/Adapter.cc +++ b/Adapter.cc @@ -42,7 +42,7 @@ namespace pEp { notifyHandshake_t _notifyHandshake = nullptr; std::thread _sync_thread; - ::utility::locked_queue< SYNC_EVENT, ::free_Sync_event > q; + ::utility::locked_queue< SYNC_EVENT, ::free_Sync_event > sync_evt_q; std::mutex m; std::thread::id sync_thread_id() @@ -54,11 +54,11 @@ namespace pEp { { try { if (ev == nullptr) { - q.clear(); - q.push_back(ev); + sync_evt_q.clear(); + sync_evt_q.push_back(ev); } else { - q.push_front(ev); + sync_evt_q.push_front(ev); } } catch (exception&) { @@ -76,7 +76,7 @@ namespace pEp { SYNC_EVENT _retrieve_next_sync_event(void *management, unsigned threshold) { SYNC_EVENT syncEvent = nullptr; - const bool success = q.try_pop_front(syncEvent, std::chrono::seconds(threshold)); + const bool success = sync_evt_q.try_pop_front(syncEvent, std::chrono::seconds(threshold)); if (!success) return new_sync_timeout_event(); @@ -138,7 +138,7 @@ namespace pEp { { SYNC_EVENT ev; try { - ev = q.back(); + ev = sync_evt_q.back(); } catch (std::underflow_error&) { return false; diff --git a/Adapter.hxx b/Adapter.hxx index 32af595..9718cde 100644 --- a/Adapter.hxx +++ b/Adapter.hxx @@ -16,7 +16,7 @@ namespace pEp { extern notifyHandshake_t _notifyHandshake; extern std::thread _sync_thread; - extern ::utility::locked_queue< SYNC_EVENT, ::free_Sync_event > q; + extern ::utility::locked_queue< SYNC_EVENT, ::free_Sync_event > sync_evt_q; extern std::mutex m; SYNC_EVENT _retrieve_next_sync_event(void *management, unsigned threshold);