aboutsummaryrefslogtreecommitdiffstats
path: root/src/core/model/GFDataExchanger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/model/GFDataExchanger.cpp')
-rw-r--r--src/core/model/GFDataExchanger.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/core/model/GFDataExchanger.cpp b/src/core/model/GFDataExchanger.cpp
index 1ce03352..d847b65d 100644
--- a/src/core/model/GFDataExchanger.cpp
+++ b/src/core/model/GFDataExchanger.cpp
@@ -38,7 +38,10 @@ auto GFDataExchanger::Write(const std::byte* buffer, size_t size) -> ssize_t {
std::unique_lock<std::mutex> lock(mutex_);
try {
for (size_t i = 0; i < size; i++) {
- if (queue_.size() == queue_max_size_) not_empty_.notify_all();
+ if (queue_.size() == static_cast<unsigned long>(queue_max_size_)) {
+ not_empty_.notify_all();
+ }
+
not_full_.wait(lock,
[=] { return queue_.size() < queue_max_size_ || close_; });
if (close_) return -1;
@@ -71,7 +74,9 @@ auto GFDataExchanger::Read(std::byte* buffer, size_t size) -> ssize_t {
read_bytes++;
}
- if (queue_.size() < queue_max_size_) not_full_.notify_all();
+ if (queue_.size() < static_cast<unsigned long>(queue_max_size_)) {
+ not_full_.notify_all();
+ }
return read_bytes;
}