Browse Source

non-local single char named vars are not that handy.

pull/5/head
heck 2 years ago
parent
commit
6cdfe86402
2 changed files with 7 additions and 7 deletions
  1. +6
    -6
      Adapter.cc
  2. +1
    -1
      Adapter.hxx

+ 6
- 6
Adapter.cc View File

@ -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;


+ 1
- 1
Adapter.hxx View File

@ -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);


Loading…
Cancel
Save