diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-05-17 01:27:58 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-05-28 00:33:55 +0200 |
| commit | 5d72e234bfe29b14a937d4095a374ae5e62adc1a (patch) | |
| tree | 6f148d7c9912a771af466bb7ba953c8954385020 /src/lib | |
| parent | 06e00ae81b6a5c510949848470bcf6b7e0f3ee81 (diff) | |
Cleanup: rename push_/pop_.
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/grok/messenger.h | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/grok/messenger.h b/src/lib/grok/messenger.h index 197aadc75..9e8cb9e4d 100644 --- a/src/lib/grok/messenger.h +++ b/src/lib/grok/messenger.h @@ -252,7 +252,7 @@ class MessengerBlockingQueue bool rc; { std::unique_lock<std::mutex> lk(mutex_); - rc = push_(value); + rc = push_unlocked(value); } if(rc) can_pop_.notify_one(); @@ -264,7 +264,7 @@ class MessengerBlockingQueue bool rc; { std::unique_lock<std::mutex> lk(mutex_); - rc = pop_(value); + rc = pop_unlocked(value); } if(rc) can_push_.notify_one(); @@ -281,7 +281,7 @@ class MessengerBlockingQueue // in case of spurious wakeup, loop until predicate in lambda // is satisfied. can_pop_.wait(lk, [this] { return !queue_.empty() || !active_; }); - rc = pop_(value); + rc = pop_unlocked(value); } if(rc) can_push_.notify_one(); @@ -290,7 +290,7 @@ class MessengerBlockingQueue } private: - bool push_(Data const& value) + bool push_unlocked(Data const& value) { if(queue_.size() == max_size_ || !active_) return false; @@ -298,7 +298,8 @@ class MessengerBlockingQueue return true; } - bool pop_(Data& value) + + bool pop_unlocked(Data& value) { if(queue_.empty() || !active_) return false; |
